[Zope-Checkins] SVN: Zope/trunk/ Launchpad #245649: the Products
package is now a proper "namespace package"
Tres Seaver
tseaver at palladion.com
Sat Jul 5 11:45:23 EDT 2008
Log message for revision 88039:
Launchpad #245649: the Products package is now a proper "namespace package"
o The rules specified by setuptools for such packages required that there
be no code in the pacakge __init__.py other than that which sets up the
namespace. Adjusted all Zope-internal code which assumed that the
'__ac_permissions__' tuple would be present unconditionally.
Changed:
U Zope/trunk/doc/CHANGES.txt
U Zope/trunk/lib/python/AccessControl/Permission.py
U Zope/trunk/lib/python/OFS/ObjectManager.py
U Zope/trunk/lib/python/Products/__init__.py
U Zope/trunk/lib/python/ZClasses/Basic.py
-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt 2008-07-05 10:11:03 UTC (rev 88038)
+++ Zope/trunk/doc/CHANGES.txt 2008-07-05 15:45:21 UTC (rev 88039)
@@ -204,6 +204,9 @@
Bugs Fixed
+ - Launchpad #245649: the Products package is now a proper
+ "namespace package" under the rules specified by setuptools.
+
- fixed outdated transaction.commit(1) call in
ZODBMountPoint.SimpleTrailblazer
Modified: Zope/trunk/lib/python/AccessControl/Permission.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/Permission.py 2008-07-05 10:11:03 UTC (rev 88038)
+++ Zope/trunk/lib/python/AccessControl/Permission.py 2008-07-05 15:45:21 UTC (rev 88039)
@@ -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/trunk/lib/python/OFS/ObjectManager.py
===================================================================
--- Zope/trunk/lib/python/OFS/ObjectManager.py 2008-07-05 10:11:03 UTC (rev 88038)
+++ Zope/trunk/lib/python/OFS/ObjectManager.py 2008-07-05 15:45:21 UTC (rev 88039)
@@ -255,7 +255,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/trunk/lib/python/Products/__init__.py
===================================================================
--- Zope/trunk/lib/python/Products/__init__.py 2008-07-05 10:11:03 UTC (rev 88038)
+++ Zope/trunk/lib/python/Products/__init__.py 2008-07-05 15:45:21 UTC (rev 88039)
@@ -10,8 +10,6 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
-__ac_permissions__=()
-
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
Modified: Zope/trunk/lib/python/ZClasses/Basic.py
===================================================================
--- Zope/trunk/lib/python/ZClasses/Basic.py 2008-07-05 10:11:03 UTC (rev 88038)
+++ Zope/trunk/lib/python/ZClasses/Basic.py 2008-07-05 15:45:21 UTC (rev 88039)
@@ -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)
More information about the Zope-Checkins
mailing list