Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos.buildout
Commits
a08076ad
Commit
a08076ad
authored
Jan 25, 2013
by
Reinout van Rees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored code duplication
parent
93c61dd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+12
-6
No files found.
src/zc/buildout/easy_install.py
View file @
a08076ad
...
@@ -171,10 +171,7 @@ class Installer:
...
@@ -171,10 +171,7 @@ class Installer:
self
.
_index
=
_get_index
(
index
,
links
,
self
.
_allow_hosts
)
self
.
_index
=
_get_index
(
index
,
links
,
self
.
_allow_hosts
)
if
versions
is
not
None
:
if
versions
is
not
None
:
# Normalize all versions to lowercase. PyPI is case-insensitive
self
.
_versions
=
normalize_versions
(
versions
)
# and not all distributions are consistent in their own naming.
self
.
_versions
=
dict
([(
k
.
lower
(),
v
)
for
(
k
,
v
)
in
versions
.
items
()])
def
_satisfied
(
self
,
req
,
source
=
None
):
def
_satisfied
(
self
,
req
,
source
=
None
):
dists
=
[
dist
for
dist
in
self
.
_env
[
req
.
project_name
]
if
dist
in
req
]
dists
=
[
dist
for
dist
in
self
.
_env
[
req
.
project_name
]
if
dist
in
req
]
...
@@ -688,11 +685,20 @@ class Installer:
...
@@ -688,11 +685,20 @@ class Installer:
if
tmp
!=
self
.
_download_cache
:
if
tmp
!=
self
.
_download_cache
:
shutil
.
rmtree
(
tmp
)
shutil
.
rmtree
(
tmp
)
def
normalize_versions
(
versions
):
"""Return version dict with keys normalized to lowercase.
PyPI is case-insensitive and not all distributions are consistent in
their own naming.
"""
return
dict
([(
k
.
lower
(),
v
)
for
(
k
,
v
)
in
versions
.
items
()])
def
default_versions
(
versions
=
None
):
def
default_versions
(
versions
=
None
):
old
=
Installer
.
_versions
old
=
Installer
.
_versions
if
versions
is
not
None
:
if
versions
is
not
None
:
Installer
.
_versions
=
dict
([(
k
.
lower
(),
v
)
Installer
.
_versions
=
normalize_versions
(
versions
)
for
(
k
,
v
)
in
versions
.
items
()])
return
old
return
old
def
download_cache
(
path
=-
1
):
def
download_cache
(
path
=-
1
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment