[Zope-PAS] zope version

Willi Langenberger wlang at wu-wien.ac.at
Fri Dec 3 17:39:50 EST 2004


According to Philipp Lacovich:
> Should it be possible to use PAS under zope 2.6.4 ?

At least not out of the box.

> Any experiences?

There are some python2.2- and python2.3-isms in the code, like nested
scopes, dict and str type objects, or boolean types.

With the following patch i got the ZODB* plugins to work.


\wlang{}

-----snip-snip-------------------------

diff -ru PAS/PluggableAuthService.py PAS264/PluggableAuthService.py
--- PAS/PluggableAuthService.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/PluggableAuthService.py	2004-12-03 23:31:32.000000000 +0100
@@ -17,6 +17,14 @@
 $Id: PluggableAuthService.py,v 1.19 2004/10/16 20:15:47 urbanape Exp $
 """
 
+from __future__ import nested_scopes
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 import sys, re, types
 
 from ZPublisher import BeforeTraverse
@@ -135,7 +143,7 @@
 
         """ Check credentials against the emergency user.
         """
-        if isinstance( credentials, dict ):
+        if type( credentials ) == type( {} ):
 
             eu = emergency_user
             eu_name = eu.getUserName()
diff -ru PAS/interfaces/plugins.py PAS264/interfaces/plugins.py
--- PAS/interfaces/plugins.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/interfaces/plugins.py	2004-12-03 22:22:06.000000000 +0100
@@ -17,6 +17,12 @@
 $Id: plugins.py,v 1.6 2004/10/04 17:41:11 urbanape Exp $
 """
 
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 from Interface import Interface
 
 class IExtractionPlugin( Interface ):
diff -ru PAS/plugins/DelegatingMultiPlugin.py PAS264/plugins/DelegatingMultiPlugin.py
--- PAS/plugins/DelegatingMultiPlugin.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/DelegatingMultiPlugin.py	2004-12-03 21:52:28.000000000 +0100
@@ -16,6 +16,8 @@
                             PluggableAuthenticationService
 """
 
+from __future__ import nested_scopes
+
 __doc__     = """ Delegating User Folder shim module """
 __version__ = '$Revision: 1.4 $'[11:-2]
 
diff -ru PAS/plugins/DynamicGroupsPlugin.py PAS264/plugins/DynamicGroupsPlugin.py
--- PAS/plugins/DynamicGroupsPlugin.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/DynamicGroupsPlugin.py	2004-12-03 22:22:43.000000000 +0100
@@ -16,6 +16,13 @@
 
 $Id: DynamicGroupsPlugin.py,v 1.3 2004/08/12 15:15:54 jens Exp $
 """
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 from Acquisition import aq_inner, aq_parent
 from AccessControl import ClassSecurityInfo
 from OFS.SimpleItem import SimpleItem
diff -ru PAS/plugins/ScriptablePlugin.py PAS264/plugins/ScriptablePlugin.py
--- PAS/plugins/ScriptablePlugin.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/ScriptablePlugin.py	2004-12-03 21:52:06.000000000 +0100
@@ -16,6 +16,9 @@
 
 $Id: ScriptablePlugin.py,v 1.3 2004/08/12 15:15:54 jens Exp $
 """
+
+from __future__ import nested_scopes
+
 from urllib import quote_plus
 from OFS.Folder import Folder
 from Acquisition import aq_parent, aq_inner
diff -ru PAS/plugins/ZODBGroupManager.py PAS264/plugins/ZODBGroupManager.py
--- PAS/plugins/ZODBGroupManager.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/ZODBGroupManager.py	2004-12-03 22:23:31.000000000 +0100
@@ -16,6 +16,13 @@
 
 $Id: ZODBGroupManager.py,v 1.4 2004/08/30 15:25:46 urbanape Exp $
 """
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 from Acquisition import aq_parent
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
@@ -84,10 +91,10 @@
         group_ids = []
         plugin_id = self.getId()
 
-        if isinstance( id, str ):
+        if type( id ) == type ( '' ):
             id = [ id ]
 
-        if isinstance( title, str ):
+        if type( title ) == type ( '' ):
             title = [ title ]
 
         if exact_match and ( id or title ):
diff -ru PAS/plugins/ZODBRoleManager.py PAS264/plugins/ZODBRoleManager.py
--- PAS/plugins/ZODBRoleManager.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/ZODBRoleManager.py	2004-12-03 22:23:46.000000000 +0100
@@ -16,6 +16,13 @@
 
 $Id: ZODBRoleManager.py,v 1.4 2004/08/30 15:27:52 urbanape Exp $
 """
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 from Acquisition import aq_parent, aq_inner
 from AccessControl import ClassSecurityInfo
 from BTrees.OOBTree import OOBTree
diff -ru PAS/plugins/ZODBUserManager.py PAS264/plugins/ZODBUserManager.py
--- PAS/plugins/ZODBUserManager.py	2004-12-01 13:05:26.000000000 +0100
+++ PAS264/plugins/ZODBUserManager.py	2004-12-03 22:24:15.000000000 +0100
@@ -16,6 +16,13 @@
 
 $Id: ZODBUserManager.py,v 1.6 2004/09/07 18:15:01 urbanape Exp $
 """
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 import sha
 
 from AccessControl import ClassSecurityInfo, AuthEncoding
@@ -123,10 +130,10 @@
         user_ids = []
         plugin_id = self.getId()
 
-        if isinstance( id, str ):
+        if type( id ) == type( '' ):
             id = [ id ]
 
-        if isinstance( login, str ):
+        if type( login ) == type ( '' ):
             login = [ login ]
 
         if exact_match and ( id or login ):


-----snip-snip-------------------------

-- 
Willi.Langenberger at wu-wien.ac.at                Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria


More information about the Zope-PAS mailing list