[Checkins] SVN: z3c.autoinclude/trunk/ fix dottedNames method to definitely not include namespace packages, even when looking in a nested namespace package with explicit namespaces for the outermost and inner namespaces

Ethan Jucovy ejucovy at openplans.org
Mon Apr 21 13:12:55 EDT 2008


Log message for revision 85546:
  fix dottedNames method to definitely not include namespace packages, even when looking in a nested namespace package with explicit namespaces for the outermost and inner namespaces

Changed:
  U   z3c.autoinclude/trunk/CHANGES.txt
  U   z3c.autoinclude/trunk/src/z3c/autoinclude/utils.py

-=-
Modified: z3c.autoinclude/trunk/CHANGES.txt
===================================================================
--- z3c.autoinclude/trunk/CHANGES.txt	2008-04-21 17:10:03 UTC (rev 85545)
+++ z3c.autoinclude/trunk/CHANGES.txt	2008-04-21 17:12:54 UTC (rev 85546)
@@ -7,6 +7,7 @@
 * Fixed bug which prevented proper inclusion of packages when the base package's namespace has been extended by other installed packages.
  * Rewrote ``distributionForPackage`` function.
  * Added additional tests for ``includePlugins`` and utility functions.
+* Fixed bug which made z3c.autoinclude look for ZCML in namespaces of nested namespace packages (eg, if there happened to -- improperly -- be an x/y/configure.zcml in a x.y.z package with an x.y namespace, it would have been included; this is incorrect.) 
 
 0.2 (2008-04-18)
 ----------------

Modified: z3c.autoinclude/trunk/src/z3c/autoinclude/utils.py
===================================================================
--- z3c.autoinclude/trunk/src/z3c/autoinclude/utils.py	2008-04-21 17:10:03 UTC (rev 85545)
+++ z3c.autoinclude/trunk/src/z3c/autoinclude/utils.py	2008-04-21 17:12:54 UTC (rev 85546)
@@ -31,7 +31,10 @@
         result = []
         for ns_dottedname in ns_dottednames:
             path = os.path.join(dist_path, *ns_dottedname.split('.'))
-            result.extend(subpackageDottedNames(path, ns_dottedname))
+            subpackages = subpackageDottedNames(path, ns_dottedname)
+            for subpackage in subpackages:
+                if subpackage not in ns_dottednames:
+                    result.append(subpackage)
         return result
     
 def subpackageDottedNames(package_path, ns_dottedname=None):



More information about the Checkins mailing list