connectors/__init__.py
changeset 1784 64beb9e9c749
parent 1773 38fde37c3766
child 1785 0ff2a45dcefa
equal deleted inserted replaced
1729:31e63e25b4cc 1784:64beb9e9c749
    32 
    32 
    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 connectors = {name:_GetLocalConnectorClassFactory(name)
    37 
    38                   for name in listdir(_base_path)
    38 connectors = {name:
    39                       if path.isdir(path.join(_base_path, name))
    39               _GetLocalConnectorClassFactory(name)
    40                           and not name.startswith("__")}
    40               for name in listdir(_base_path)
       
    41               if (path.isdir(path.join(_base_path, name))
       
    42                   and not name.startswith("__"))}
    41 
    43 
    42 
    44 
    43 def ConnectorFactory(uri, confnodesroot):
    45 def ConnectorFactory(uri, confnodesroot):
    44     """
    46     """
    45     Return a connector corresponding to the URI
    47     Return a connector corresponding to the URI