[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command easy_install.py, 1.34, 1.35

pje@users.sourceforge.net pje at users.sourceforge.net
Wed Oct 19 05:00:38 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17238/setuptools/command

Modified Files:
	easy_install.py 
Log Message:
Added "--allow-hosts" option to restrict downloading and spidering to
a specified list of server glob patterns.


Index: easy_install.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/easy_install.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- easy_install.py	18 Oct 2005 04:08:46 -0000	1.34
+++ easy_install.py	19 Oct 2005 03:00:35 -0000	1.35
@@ -43,7 +43,6 @@
     """Manage a download/build/install process"""
 
     description = "Find/get/install Python packages"
-
     command_consumes_arguments = True
 
     user_options = [
@@ -71,6 +70,7 @@
         ('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 @@
         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 @@
         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 @@
                 "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 @@
             log.set_verbosity(self.distribution.verbose)
 
 
-
-
-
-
-
     def install_egg_scripts(self, dist):
         """Write all the scripts for `dist`, unless scripts are excluded"""
 



More information about the Python-checkins mailing list