[CMF-checkins] CVS: Products/CMFCore - MembershipTool.py:1.54

Florent Guillaume fg at nuxeo.com
Fri Jul 8 09:40:19 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv11213

Modified Files:
	MembershipTool.py 
Log Message:
Merge from 1.5 branch: Cleanup code.


=== Products/CMFCore/MembershipTool.py 1.53 => 1.54 ===
--- Products/CMFCore/MembershipTool.py:1.53	Thu Jul  7 14:27:46 2005
+++ Products/CMFCore/MembershipTool.py	Fri Jul  8 09:40:19 2005
@@ -346,23 +346,23 @@
         '''
         Returns the given member.
         '''
-        def hauntUser(username,start):
-            """Find user in the hierarchy starting from bottom level 'start'.
-            """
-            uf = start.acl_users
-            while uf is not None:
-                user = uf.getUserById(username)
-                if user:
-                    return user
-                parent = aq_parent(aq_inner(uf))
-                parent = aq_parent(aq_inner(parent))
-                uf = getattr(parent, 'acl_users', None)
-            return None
-
-        user = hauntUser(id, self)
+        user = self._huntUser(id, self)
         if user is not None:
             user = self.wrapUser(user)
         return user
+
+    def _huntUser(self, username, context):
+        """Find user in the hierarchy starting from bottom level 'start'.
+        """
+        uf = context.acl_users
+        while uf is not None:
+            user = uf.getUserById(username)
+            if user is not None:
+                return user
+            container = aq_parent(aq_inner(uf))
+            parent = aq_parent(aq_inner(container))
+            uf = getattr(parent, 'acl_users', None)
+        return None
 
     def __getPUS(self):
         # Gets something we can call getUsers() and getUserNames() on.



More information about the CMF-checkins mailing list