예제 #1
0
 def __init__(self, name, socket_file, fields):
     """
     Construct the module with its *name*, and its *fields*. Also try to
     create a socket unix server endpoint on *socket_file* path.
     """
     threading.Thread.__init__(self)
     self.name = name
     self.fields = fields
     self.ready_file = path.ready_file(self.name)
     self.exitcode = self.SUCCESS_EXIT
     if os.path.exists(socket_file):
         os.remove(socket_file)
     endpoint = ServerEndpoint(reactor, socket_file)
     endpoint.listen(connection.Factory(self))
예제 #2
0
def is_ready(module_name):
    """
    Return if the module *module_name* is ready.
    This is detected by watching the ready file of the module.
    """
    return os.path.exists(path.ready_file(module_name))
예제 #3
0
파일: remote.py 프로젝트: jmcomets/KHome
def is_ready(module_name):
    """
    Return if the module *module_name* is ready.
    This is detected by watching the ready file of the module.
    """
    return os.path.exists(path.ready_file(module_name))