connectors/__init__.py
changeset 1767 c74815729afd
parent 1749 d73b64672238
child 1773 38fde37c3766
equal deleted inserted replaced
1766:c1e5b9f19483 1767:c74815729afd
    33 
    33 
    34 def _GetLocalConnectorClassFactory(name):
    34 def _GetLocalConnectorClassFactory(name):
    35     return lambda: getattr(__import__(name, globals(), locals()), name + "_connector_factory")
    35     return lambda: getattr(__import__(name, globals(), locals()), name + "_connector_factory")
    36 
    36 
    37 
    37 
    38 connectors = {name: _GetLocalConnectorClassFactory(name)
    38 connectors = {name:
    39                   for name in listdir(_base_path)
    39               _GetLocalConnectorClassFactory(name)
    40                       if path.isdir(path.join(_base_path, name))
    40               for name in listdir(_base_path)
    41                           and not name.startswith("__")}
    41               if (path.isdir(path.join(_base_path, name))
       
    42                   and not name.startswith("__"))
       
    43 }
    42 
    44 
    43 
    45 
    44 def ConnectorFactory(uri, confnodesroot):
    46 def ConnectorFactory(uri, confnodesroot):
    45     """
    47     """
    46     Return a connector corresponding to the URI
    48     Return a connector corresponding to the URI