Ejemplo n.º 1
0
 def __init__(self, name=None, _app_path=None):
     """``_app_path`` defines an alternative path for app root and is
     for testing purposes only
     """
     BaseNode.__init__(self, name)
     path = os.path.join(_app_path or APP_PATH, 'etc', 'ldap.xml')
     self._config = XMLProperties(path)
     self.invalidate()
Ejemplo n.º 2
0
 def __getitem__(self, name):
     try:
         return BaseNode.__getitem__(self, name)
     except KeyError:
         if not name in self.iterkeys():
             raise KeyError(name)
         user = User(self.ldap_users[name], name, self)
         self[name] = user
         return user
Ejemplo n.º 3
0
 def __getitem__(self, name):
     try:
         return BaseNode.__getitem__(self, name)
     except KeyError:
         if not name in self.iterkeys():
             raise KeyError(name)
         # XXX: Group(ldapNode, name, self)
         group = Group(BaseNode(), name, self)
         self[name] = group
         return group