Log message for revision 88054:
  Backport fix for LP#245649.

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/AccessControl/Permission.py
  U   Zope/branches/2.9/lib/python/AccessControl/Role.py
  U   Zope/branches/2.9/lib/python/OFS/ObjectManager.py
  U   Zope/branches/2.9/lib/python/Products/__init__.py
  U   Zope/branches/2.9/lib/python/ZClasses/Basic.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt   2008-07-06 01:14:13 UTC (rev 88053)
+++ Zope/branches/2.9/doc/CHANGES.txt   2008-07-06 01:51:42 UTC (rev 88054)
@@ -8,6 +8,9 @@
 
    Bugs fixed
 
+      - Launchpad #245649:  the Products package is now a proper
+        "namespace package" under the rules specified by setuptools.
+
       - Launchpad #239636:  Ensure that HEAD requests lock an empty body
         for NotFound errors.
 

Modified: Zope/branches/2.9/lib/python/AccessControl/Permission.py
===================================================================
--- Zope/branches/2.9/lib/python/AccessControl/Permission.py    2008-07-06 
01:14:13 UTC (rev 88053)
+++ Zope/branches/2.9/lib/python/AccessControl/Permission.py    2008-07-06 
01:51:42 UTC (rev 88054)
@@ -129,8 +129,9 @@
         else:
             perm, methods, default = setting
         _registeredPermissions[perm]=1
+        Products_permissions = getattr(Products, '__ac_permissions__', ())
         Products.__ac_permissions__=(
-            Products.__ac_permissions__+((perm,(),default),))
+            Products_permissions + ((perm, (), default),))
         mangled=pname(perm) # get mangled permission name
         if not hasattr(Globals.ApplicationDefaultPermissions, mangled):
             setattr(Globals.ApplicationDefaultPermissions,

Modified: Zope/branches/2.9/lib/python/AccessControl/Role.py
===================================================================
--- Zope/branches/2.9/lib/python/AccessControl/Role.py  2008-07-06 01:14:13 UTC 
(rev 88053)
+++ Zope/branches/2.9/lib/python/AccessControl/Role.py  2008-07-06 01:51:42 UTC 
(rev 88054)
@@ -532,7 +532,8 @@
 
     def possible_permissions(self):
         d={}
-        for p in Products.__ac_permissions__:
+        Products_permissions = getattr(Products, '__ac_permissions__', ())
+        for p in Products_permissions:
             d[p[0]]=1
         for p in self.aq_acquire('_getProductRegistryData')('ac_permissions'):
             d[p[0]]=1

Modified: Zope/branches/2.9/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2008-07-06 01:14:13 UTC 
(rev 88053)
+++ Zope/branches/2.9/lib/python/OFS/ObjectManager.py   2008-07-06 01:51:42 UTC 
(rev 88054)
@@ -236,7 +236,8 @@
         return meta_types
 
     def _subobject_permissions(self):
-        return (Products.__ac_permissions__+
+        Products_permissions = getattr(Products, '__ac_permissions__', ())
+        return (Products_permissions +
                 self.aq_acquire('_getProductRegistryData')('ac_permissions')
                 )
 

Modified: Zope/branches/2.9/lib/python/Products/__init__.py
===================================================================
--- Zope/branches/2.9/lib/python/Products/__init__.py   2008-07-06 01:14:13 UTC 
(rev 88053)
+++ Zope/branches/2.9/lib/python/Products/__init__.py   2008-07-06 01:51:42 UTC 
(rev 88054)
@@ -10,4 +10,9 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
-__ac_permissions__=()
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Modified: Zope/branches/2.9/lib/python/ZClasses/Basic.py
===================================================================
--- Zope/branches/2.9/lib/python/ZClasses/Basic.py      2008-07-06 01:14:13 UTC 
(rev 88053)
+++ Zope/branches/2.9/lib/python/ZClasses/Basic.py      2008-07-06 01:51:42 UTC 
(rev 88054)
@@ -189,9 +189,10 @@
     manage=Globals.DTMLFile('dtml/classPermissions', globals())
 
     def possible_permissions(self):
+        Products_permissions = getattr(Products, '__ac_permissions__', ())
         r=map(
             lambda p: p[0],
-            Products.__ac_permissions__+
+            Products_permissions +
             self.aq_acquire('_getProductRegistryData')('ac_permissions')
             )
         r.sort()
@@ -199,9 +200,10 @@
 
     def manage_edit(self, selected=[], REQUEST=None):
         "Remove some permissions"
+        Products_permissions = getattr(Products, '__ac_permissions__', ())
         r=[]
         for p in (
-            Products.__ac_permissions__+
+            Products_permissions +
             self.aq_acquire('_getProductRegistryData')('ac_permissions')):
             if p[0] in selected:
                 r.append(p)

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to