[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command egg_info.py, 1.7, 1.8

pje@users.sourceforge.net pje at users.sourceforge.net
Sun Jul 24 19:59:29 CEST 2005


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

Modified Files:
	egg_info.py 
Log Message:
Fix eager resource extraction. Add eager_resources setup() argument.  Add
support for obtaining project-level resources by making get_provider()
accept Requirement objects.


Index: egg_info.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/egg_info.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- egg_info.py	16 Jul 2005 16:43:02 -0000	1.7
+++ egg_info.py	24 Jul 2005 17:59:27 -0000	1.8
@@ -96,13 +96,13 @@
             finally:
                 metadata.name, metadata.version = oldname, oldver
 
-        self.write_namespace_packages()
         self.write_requirements()
         self.write_toplevel_names()
-
+        self.write_or_delete_dist_arg('namespace_packages')
+        self.write_or_delete_dist_arg('eager_resources')
         if os.path.exists(os.path.join(self.egg_info,'depends.txt')):
             log.warn(
-                "WARNING: 'depends.txt' will not be used by setuptools 0.6!\n"
+                "WARNING: 'depends.txt' is not used by setuptools 0.6!\n"
                 "Use the install_requires/extras_require setup() args instead."
             )
 
@@ -162,18 +162,19 @@
 
 
 
-    def write_namespace_packages(self):
-        nsp = getattr(self.distribution,'namespace_packages',None)
-        if nsp is None:
+    def write_or_delete_dist_arg(self, argname, filename=None):
+        value = getattr(self.distribution, argname, None)
+        if value is None:
             return
 
-        filename = os.path.join(self.egg_info,"namespace_packages.txt")
+        filename = filename or argname+'.txt'
+        filename = os.path.join(self.egg_info,filename)
 
-        if nsp:
+        if value:
             log.info("writing %s", filename)
             if not self.dry_run:
                 f = open(filename, 'wt')
-                f.write('\n'.join(nsp))
+                f.write('\n'.join(value))
                 f.write('\n')
                 f.close()
 
@@ -202,4 +203,3 @@
 
 
 
-



More information about the Python-checkins mailing list