[Zope-Checkins] SVN: Zope/trunk/lib/python/ZClasses/ Remove ZClasses from the main code tree

2009-01-23 Thread Hanno Schlichting
Log message for revision 94964:
  Remove ZClasses from the main code tree
  

Changed:
  D   Zope/trunk/lib/python/ZClasses/

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ Seems some of these functions have persistent references to them in a standard install, so we better leave them in place.

2009-01-23 Thread Hanno Schlichting
Log message for revision 94965:
  Seems some of these functions have persistent references to them in a 
standard install, so we better leave them in place.
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/PermissionMapping.py
  U   Zope/trunk/lib/python/AccessControl/Role.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/PermissionMapping.py
===
--- Zope/trunk/lib/python/AccessControl/PermissionMapping.py2009-01-23 
18:32:02 UTC (rev 94964)
+++ Zope/trunk/lib/python/AccessControl/PermissionMapping.py2009-01-23 
18:51:41 UTC (rev 94965)
@@ -91,6 +91,19 @@
 REQUEST,
 manage_tabs_message='The permission mapping has been updated')
 
+def _isBeingUsedAsAMethod(self, REQUEST =None, wannaBe=0):
+try:
+if hasattr(self, 'aq_self'):
+r=self.aq_acquire('_isBeingUsedAsAMethod_')
+else:
+r=self._isBeingUsedAsAMethod_
+except: r=0
+
+if REQUEST is not None:
+if not r != (not wannaBe): REQUEST.response.notFoundError()
+
+return r
+
 InitializeClass(RoleManager)
 
 

Modified: Zope/trunk/lib/python/AccessControl/Role.py
===
--- Zope/trunk/lib/python/AccessControl/Role.py 2009-01-23 18:32:02 UTC (rev 
94964)
+++ Zope/trunk/lib/python/AccessControl/Role.py 2009-01-23 18:51:41 UTC (rev 
94965)
@@ -18,6 +18,7 @@
 
 from Acquisition import Acquired
 from Acquisition import aq_base
+from Acquisition import aq_get
 from AccessControl import ClassSecurityInfo
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.Permissions import change_permissions
@@ -34,7 +35,13 @@
 
 DEFAULTMAXLISTUSERS=250
 
+def _isBeingUsedAsAMethod(self):
+return aq_get(self, '_isBeingUsedAsAMethod_', 0)
 
+def _isNotBeingUsedAsAMethod(self):
+return not aq_get(self, '_isBeingUsedAsAMethod_', 0)
+
+
 class RoleManager(Base, RoleManager):
 
 An object that has configurable permissions

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


[Zope-Checkins] SVN: Zope/trunk/ The persistent product registry is not required for starting Zope anymore. `enable-product-installation` can be set to off if you don't rely on the functionality provi

2009-01-23 Thread Hanno Schlichting
Log message for revision 94966:
  The persistent product registry is not required for starting Zope anymore. 
`enable-product-installation` can be set to off if you don't rely on the 
functionality provided by the registry.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2009-01-23 18:51:41 UTC (rev 94965)
+++ Zope/trunk/doc/CHANGES.txt  2009-01-23 19:49:23 UTC (rev 94966)
@@ -9,6 +9,10 @@
 
 Restructuring
 
+  - The persistent product registry is not required for starting Zope
+anymore. `enable-product-installation` can be set to off if you don't
+rely on the functionality provided by the registry.
+
   - ZClasses have been deprecated for two major releases. They have been
 removed in this version of Zope.
 

Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===
--- Zope/trunk/lib/python/App/FactoryDispatcher.py  2009-01-23 18:51:41 UTC 
(rev 94965)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2009-01-23 19:49:23 UTC 
(rev 94966)
@@ -40,6 +40,38 @@
 
 return packages
 
+
+class Product(object):
+Model a non-persistent product wrapper.
+
+
+security = ClassSecurityInfo()
+
+meta_type='Product'
+icon='p_/Product_icon'
+version=''
+configurable_objects_=()
+import_error_=None
+thisIsAnInstalledProduct = True
+title = 'This is a non-persistent product wrapper.'
+
+def __init__(self, id):
+self.id=id
+
+security.declarePublic('Destination')
+def Destination(self):
+Return the destination for factory output
+return self
+
+def getProductHelp(self):
+Returns the ProductHelp object associated with the Product.
+
+from HelpSys.HelpSys import ProductHelp
+return ProductHelp('Help', self.id).__of__(self)
+
+InitializeClass(Product)
+
+
 class ProductDispatcher(Implicit):
  
 # Allow access to factory dispatchers
@@ -49,14 +81,19 @@
 return self.__bobo_traverse__(None, name)
 
 def __bobo_traverse__(self, REQUEST, name):
-product=self.aq_acquire('_getProducts')()._product(name)
-
 # Try to get a custom dispatcher from a Python product
 dispatcher_class=getattr(
 _product_packages().get(name, None),
 '__FactoryDispatcher__',
 FactoryDispatcher)
 
+productfolder = self.aq_acquire('_getProducts')()
+try:
+product = productfolder._product(name)
+except AttributeError:
+# If we do not have a persistent product entry, return 
+product = Product(name)
+
 dispatcher=dispatcher_class(product, self.aq_parent, REQUEST)
 return dispatcher.__of__(self)
 

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