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

Florent Guillaume fg at nuxeo.com
Fri Jul 8 09:38:20 EDT 2005


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

Modified Files:
      Tag: CMF-1_5-branch
	MembershipTool.py 
Log Message:
Cleanup code.


=== Products/CMFCore/MembershipTool.py 1.49.2.4 => 1.49.2.5 ===
--- Products/CMFCore/MembershipTool.py:1.49.2.4	Thu Jul  7 14:24:19 2005
+++ Products/CMFCore/MembershipTool.py	Fri Jul  8 09:38: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