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
Łukasz Nowak
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
Show 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:
self
.
_index
=
_get_index
(
index
,
links
,
self
.
_allow_hosts
)
if
versions
is
not
None
:
# Normalize all versions to lowercase. PyPI is case-insensitive
# and not all distributions are consistent in their own naming.
self
.
_versions
=
dict
([(
k
.
lower
(),
v
)
for
(
k
,
v
)
in
versions
.
items
()])
self
.
_versions
=
normalize_versions
(
versions
)
def
_satisfied
(
self
,
req
,
source
=
None
):
dists
=
[
dist
for
dist
in
self
.
_env
[
req
.
project_name
]
if
dist
in
req
]
...
...
@@ -688,11 +685,20 @@ class Installer:
if
tmp
!=
self
.
_download_cache
:
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
):
old
=
Installer
.
_versions
if
versions
is
not
None
:
Installer
.
_versions
=
dict
([(
k
.
lower
(),
v
)
for
(
k
,
v
)
in
versions
.
items
()])
Installer
.
_versions
=
normalize_versions
(
versions
)
return
old
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