[Checkins] SVN: PluggableAuthService/trunk/ - Removed some BBB code for Zope versions < 2.8, which is not needed

Jens Vagelpohl jens at dataflake.org
Fri Oct 20 15:25:57 EDT 2006


Log message for revision 70851:
  - Removed some BBB code for Zope versions < 2.8, which is not needed
    since we require Zope > 2.8.5 nowadays.
  

Changed:
  U   PluggableAuthService/trunk/doc/CHANGES.txt
  U   PluggableAuthService/trunk/plugins/BasePlugin.py
  U   PluggableAuthService/trunk/plugins/ChallengeProtocolChooser.py
  U   PluggableAuthService/trunk/plugins/CookieAuthHelper.py
  U   PluggableAuthService/trunk/plugins/DelegatingMultiPlugin.py
  U   PluggableAuthService/trunk/plugins/DomainAuthHelper.py
  U   PluggableAuthService/trunk/plugins/DynamicGroupsPlugin.py
  U   PluggableAuthService/trunk/plugins/HTTPBasicAuthHelper.py
  U   PluggableAuthService/trunk/plugins/InlineAuthHelper.py
  U   PluggableAuthService/trunk/plugins/LocalRolePlugin.py
  U   PluggableAuthService/trunk/plugins/RecursiveGroupsPlugin.py
  U   PluggableAuthService/trunk/plugins/RequestTypeSniffer.py
  U   PluggableAuthService/trunk/plugins/ScriptablePlugin.py
  U   PluggableAuthService/trunk/plugins/SearchPrincipalsPlugin.py
  U   PluggableAuthService/trunk/plugins/SessionAuthHelper.py
  U   PluggableAuthService/trunk/plugins/ZODBGroupManager.py
  U   PluggableAuthService/trunk/plugins/ZODBRoleManager.py
  U   PluggableAuthService/trunk/plugins/ZODBUserManager.py
  U   PluggableAuthService/trunk/plugins/tests/test_ScriptablePlugin.py
  U   PluggableAuthService/trunk/utils.py

-=-
Modified: PluggableAuthService/trunk/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/trunk/doc/CHANGES.txt	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/doc/CHANGES.txt	2006-10-20 19:25:56 UTC (rev 70851)
@@ -24,7 +24,11 @@
       - Made sure the emergency user via HTTP basic auth always wins, no matter
         how borken the plugin landscape.
 
+    Other
 
+      - Removed some BBB code for Zope versions < 2.8, which is not needed 
+        since we require Zope > 2.8.5 nowadays.
+
   PluggableAuthService 1.4 (2006/08/28)
 
     Bugs Fixed

Modified: PluggableAuthService/trunk/plugins/BasePlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/BasePlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/BasePlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -23,11 +23,12 @@
 from App.class_init import default__class_init__ as InitializeClass
 from Interface.Implements import flattenInterfaces
 
+from zope.interface import implementedBy
+from zope.interface import providedBy
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import implementedBy
-from Products.PluggableAuthService.utils import providedBy
 from Products.PluggableAuthService.permissions import ManageUsers
 
 class BasePlugin(SimpleItem, PropertyManager):

Modified: PluggableAuthService/trunk/plugins/ChallengeProtocolChooser.py
===================================================================
--- PluggableAuthService/trunk/plugins/ChallengeProtocolChooser.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/ChallengeProtocolChooser.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -22,6 +22,8 @@
 from BTrees.OOBTree import OOBTree
 from Globals import InitializeClass
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
@@ -41,7 +43,6 @@
 
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IChallengeProtocolChooserPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/CookieAuthHelper.py
===================================================================
--- PluggableAuthService/trunk/plugins/CookieAuthHelper.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/CookieAuthHelper.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -24,6 +24,9 @@
 from AccessControl.Permissions import view
 from OFS.Folder import Folder
 from App.class_init import default__class_init__ as InitializeClass
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 
@@ -37,7 +40,6 @@
         ICredentialsResetPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 
 class ICookieAuthHelper(Interface):

Modified: PluggableAuthService/trunk/plugins/DelegatingMultiPlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/DelegatingMultiPlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/DelegatingMultiPlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -29,6 +29,9 @@
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 from AccessControl.SpecialUsers import emergency_user
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins import \
@@ -45,7 +48,6 @@
     IPropertiesPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IDelegatingMultiPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/DomainAuthHelper.py
===================================================================
--- PluggableAuthService/trunk/plugins/DomainAuthHelper.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/DomainAuthHelper.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -26,6 +26,9 @@
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 from AccessControl.Permissions import manage_users
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 # PluggableAuthService imports
@@ -37,7 +40,6 @@
     IRolesPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IDomainAuthHelper(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/DynamicGroupsPlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/DynamicGroupsPlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/DynamicGroupsPlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -27,6 +27,8 @@
 from Globals import InitializeClass
 from Persistence import PersistentMapping
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.Expressions import getEngine
 
@@ -38,7 +40,6 @@
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import createViewName
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IDynamicGroupsPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/HTTPBasicAuthHelper.py
===================================================================
--- PluggableAuthService/trunk/plugins/HTTPBasicAuthHelper.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/HTTPBasicAuthHelper.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -22,6 +22,8 @@
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from App.class_init import default__class_init__ as InitializeClass
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PluggableAuthService.interfaces.plugins import \
         ILoginPasswordHostExtractionPlugin
@@ -30,7 +32,6 @@
 from Products.PluggableAuthService.interfaces.plugins import \
         ICredentialsResetPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
-from Products.PluggableAuthService.utils import Interface
 from Products.PluggableAuthService.utils import classImplements
 
 

Modified: PluggableAuthService/trunk/plugins/InlineAuthHelper.py
===================================================================
--- PluggableAuthService/trunk/plugins/InlineAuthHelper.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/InlineAuthHelper.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -23,6 +23,9 @@
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from OFS.Folder import Folder
 from App.class_init import default__class_init__ as InitializeClass
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.ZopePageTemplate import manage_addPageTemplate
 
@@ -36,7 +39,6 @@
         ICredentialsResetPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IInlineAuthHelper(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/LocalRolePlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/LocalRolePlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/LocalRolePlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -19,12 +19,13 @@
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class ILocalRolePlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/RecursiveGroupsPlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/RecursiveGroupsPlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/RecursiveGroupsPlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -20,16 +20,17 @@
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 from BTrees.OOBTree import OOBTree
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
     import IGroupsPlugin
-
 from Products.PluggableAuthService.PropertiedUser import PropertiedUser
 from Products.PluggableAuthService.permissions import ManageGroups
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IRecursiveGroupsPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/RequestTypeSniffer.py
===================================================================
--- PluggableAuthService/trunk/plugins/RequestTypeSniffer.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/RequestTypeSniffer.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -23,6 +23,8 @@
 from ZServer.FTPRequest import FTPRequest
 from ZPublisher import xmlrpc
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
@@ -37,7 +39,6 @@
     import IXMLRPCRequest
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IRequestTypeSnifferPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/ScriptablePlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/ScriptablePlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/ScriptablePlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -22,14 +22,16 @@
 from AccessControl import ClassSecurityInfo
 from AccessControl.Permissions import manage_users as ManageUsers
 from App.class_init import default__class_init__ as InitializeClass
+
+from zope.interface import Interface
+from zope.interface import implementedBy
+from zope.interface import providedBy
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import directlyProvides
-from Products.PluggableAuthService.utils import providedBy
-from Products.PluggableAuthService.utils import implementedBy
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IScriptablePlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/SearchPrincipalsPlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/SearchPrincipalsPlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/SearchPrincipalsPlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -27,6 +27,9 @@
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 from AccessControl.SpecialUsers import emergency_user
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins import \
@@ -35,7 +38,6 @@
      IGroupEnumerationPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class ISearchPrincipalsPlugin(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/SessionAuthHelper.py
===================================================================
--- PluggableAuthService/trunk/plugins/SessionAuthHelper.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/SessionAuthHelper.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -19,6 +19,9 @@
 
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from App.class_init import default__class_init__ as InitializeClass
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins import \
@@ -29,7 +32,6 @@
         ICredentialsResetPlugin
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class ISessionAuthHelper(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/ZODBGroupManager.py
===================================================================
--- PluggableAuthService/trunk/plugins/ZODBGroupManager.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/ZODBGroupManager.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -20,6 +20,9 @@
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 from BTrees.OOBTree import OOBTree
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
@@ -30,7 +33,6 @@
 from Products.PluggableAuthService.permissions import ManageGroups
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IZODBGroupManager(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/ZODBRoleManager.py
===================================================================
--- PluggableAuthService/trunk/plugins/ZODBRoleManager.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/ZODBRoleManager.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -21,6 +21,8 @@
 from BTrees.OOBTree import OOBTree
 from Globals import InitializeClass
 
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
@@ -33,7 +35,6 @@
 from Products.PluggableAuthService.permissions import ManageUsers
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
-from Products.PluggableAuthService.utils import Interface
 
 class IZODBRoleManager(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/ZODBUserManager.py
===================================================================
--- PluggableAuthService/trunk/plugins/ZODBUserManager.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/ZODBUserManager.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -24,6 +24,9 @@
 from App.class_init import default__class_init__ as InitializeClass
 from BTrees.OOBTree import OOBTree
 from OFS.Cache import Cacheable
+
+from zope.interface import Interface
+
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.interfaces.plugins \
@@ -38,7 +41,6 @@
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.utils import createViewName
-from Products.PluggableAuthService.utils import Interface
 
 class IZODBUserManager(Interface):
     """ Marker interface.

Modified: PluggableAuthService/trunk/plugins/tests/test_ScriptablePlugin.py
===================================================================
--- PluggableAuthService/trunk/plugins/tests/test_ScriptablePlugin.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/plugins/tests/test_ScriptablePlugin.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -16,13 +16,9 @@
 from OFS.Folder import Folder
 from OFS.SimpleItem import SimpleItem
 
-try:
-    from zope.interface import Interface
-except ImportError:
-    from Interface import Interface
+from zope.interface import Interface
+from zope.interface import providedBy
 
-from Products.PluggableAuthService.utils import providedBy
-
 class IFaux( Interface ):
 
     def faux_method():

Modified: PluggableAuthService/trunk/utils.py
===================================================================
--- PluggableAuthService/trunk/utils.py	2006-10-20 18:44:07 UTC (rev 70850)
+++ PluggableAuthService/trunk/utils.py	2006-10-20 19:25:56 UTC (rev 70851)
@@ -15,35 +15,10 @@
 import os
 import sha
 import unittest
-from types import TupleType, ListType
 
 from Globals import package_home
 
-def tuplize(value):
-    if isinstance(value, TupleType):
-        return value
-    if isinstance(value, ListType):
-        return tuple(value)
-    return (value,)
-
 try:
-    from zope.interface import Interface
-except ImportError:
-    from Interface import Interface
-
-try:
-    from zope.interface import providedBy
-except ImportError:
-    def providedBy(obj):
-        return tuplize(obj.__implements__)
-
-try:
-    from zope.interface import implementedBy
-except ImportError:
-    def implementedBy(klass):
-        return tuplize(klass.__implements__)
-
-try:
     from Products.Five.bridge import fromZ2Interface
 except ImportError:
     def fromZ2Interface(i):
@@ -51,39 +26,30 @@
         # zope.interface is available but Five is not.
         raise ValueError, i
 
-try:
-    from zope import interface
-except ImportError:
-    def directlyProvides(obj, *interfaces):
-        obj.__implements__ = tuple( interfaces )
+from zope import interface
+def directlyProvides(obj, *interfaces):
+    # convert any Zope 2 interfaces to Zope 3 using fromZ2Interface
+    normalized_interfaces = []
+    for i in interfaces:
+        try:
+            i = fromZ2Interface(i)
+        except ValueError: # already a Zope 3 interface
+            pass
+        normalized_interfaces.append(i)
+    return interface.directlyProvides(obj, *normalized_interfaces)
 
-    def classImplements(class_, *interfaces):
-        class_.__implements__ = tuple( interfaces )
+def classImplements(class_, *interfaces):
+    # convert any Zope 2 interfaces to Zope 3 using fromZ2Interface
+    normalized_interfaces = []
+    for i in interfaces:
+        try:
+            i = fromZ2Interface(i)
+        except ValueError: # already a Zope 3 interface
+            pass
+        normalized_interfaces.append(i)
+    return interface.classImplements(class_, *normalized_interfaces)
 
-else:
-    def directlyProvides(obj, *interfaces):
-        # convert any Zope 2 interfaces to Zope 3 using fromZ2Interface
-        normalized_interfaces = []
-        for i in interfaces:
-            try:
-                i = fromZ2Interface(i)
-            except ValueError: # already a Zope 3 interface
-                pass
-            normalized_interfaces.append(i)
-        return interface.directlyProvides(obj, *normalized_interfaces)
 
-    def classImplements(class_, *interfaces):
-        # convert any Zope 2 interfaces to Zope 3 using fromZ2Interface
-        normalized_interfaces = []
-        for i in interfaces:
-            try:
-                i = fromZ2Interface(i)
-            except ValueError: # already a Zope 3 interface
-                pass
-            normalized_interfaces.append(i)
-        return interface.classImplements(class_, *normalized_interfaces)
-
-
 product_dir = package_home( globals() )
 product_prefix = os.path.join( os.path.split(product_dir)[:-1] )
 



More information about the Checkins mailing list