[Python-checkins] python/nondist/sandbox/setuptools/setuptools dist.py, 1.21, 1.22

pje@users.sourceforge.net pje at users.sourceforge.net
Sun Aug 14 23:14:56 CEST 2005


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

Modified Files:
	dist.py 
Log Message:
Minor refactoring of code that checks a distribution's contents.


Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/dist.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- dist.py	14 Aug 2005 20:18:56 -0000	1.21
+++ dist.py	14 Aug 2005 21:14:46 -0000	1.22
@@ -53,9 +53,7 @@
     assert_string_list(dist,attr,value)
 
     for nsp in value:
-        for name in dist.iter_distribution_names():
-            if name.startswith(nsp+'.'): break
-        else:
+        if not dist.has_contents_for(nsp):
             raise DistutilsSetupError(
                 "Distribution contains no modules or packages for " +
                 "namespace package %r" % nsp
@@ -80,6 +78,8 @@
             "%r must be a boolean value (got %r)" % (attr,value)
         )
 
+
+
 def check_install_requires(dist, attr, value):
     """Verify that install_requires is a valid requirements list"""
     try:
@@ -436,17 +436,17 @@
 
         pfx = package+'.'
 
-        for p in self.packages or ():
+        for p in self.iter_distribution_names():
             if p==package or p.startswith(pfx):
                 return True
 
-        for p in self.py_modules or ():
-            if p==package or p.startswith(pfx):
-                return True
 
-        for p in self.ext_modules or ():
-            if p.name==package or p.name.startswith(pfx):
-                return True
+
+
+
+
+
+
 
 
     def _exclude_misc(self,name,value):



More information about the Python-checkins mailing list