aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-10-19 03:00:35 +0000
committerPJ Eby <distutils-sig@python.org>2005-10-19 03:00:35 +0000
commit272fed819ba188ac5d6c0ceb9de6d7a8cb543a18 (patch)
tree53446d778b3cd6ac08470faa5ff28c168d406b40 /setuptools/command/easy_install.py
parent741f1742fee6d55a6a278ff44215aaf0959381c5 (diff)
downloadexternal_python_setuptools-272fed819ba188ac5d6c0ceb9de6d7a8cb543a18.tar.gz
external_python_setuptools-272fed819ba188ac5d6c0ceb9de6d7a8cb543a18.tar.bz2
external_python_setuptools-272fed819ba188ac5d6c0ceb9de6d7a8cb543a18.zip
Added "--allow-hosts" option to restrict downloading and spidering to
a specified list of server glob patterns. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041266
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index c076a5fd..ad19a732 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -43,7 +43,6 @@ class easy_install(Command):
"""Manage a download/build/install process"""
description = "Find/get/install Python packages"
-
command_consumes_arguments = True
user_options = [
@@ -71,6 +70,7 @@ class easy_install(Command):
('site-dirs=','S',"list of directories where .pth files work"),
('editable', 'e', "Install specified packages in editable form"),
('no-deps', 'N', "don't install dependencies"),
+ ('allow-hosts=', 'H', "pattern(s) that hostnames must match"),
]
boolean_options = [
'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy',
@@ -89,7 +89,7 @@ class easy_install(Command):
self.args = None
self.optimize = self.record = None
self.upgrade = self.always_copy = self.multi_version = None
- self.editable = self.no_deps = None
+ self.editable = self.no_deps = self.allow_hosts = None
self.root = None
# Options not specifiable via command line
@@ -177,9 +177,15 @@ class easy_install(Command):
for path_item in self.install_dir, normalize_path(self.script_dir):
if path_item not in self.shadow_path:
self.shadow_path.insert(0, path_item)
+
+ if self.allow_hosts is not None:
+ hosts = [s.strip() for s in self.allow_hosts.split(',')]
+ else:
+ hosts = ['*']
+
if self.package_index is None:
self.package_index = self.create_index(
- self.index_url, search_path = self.shadow_path
+ self.index_url, search_path = self.shadow_path, hosts=hosts
)
self.local_index = Environment(self.shadow_path)
@@ -202,7 +208,6 @@ class easy_install(Command):
"Can't use both --delete-conflicting and "
"--ignore-conflicts-at-my-risk at the same time"
)
-
if self.editable and not self.build_directory:
raise DistutilsArgError(
"Must specify a build directory (-b) when using --editable"
@@ -239,11 +244,6 @@ class easy_install(Command):
log.set_verbosity(self.distribution.verbose)
-
-
-
-
-
def install_egg_scripts(self, dist):
"""Write all the scripts for `dist`, unless scripts are excluded"""