def __init__ (self): from app import APP self.logger = APP.LoggingClient(name="UIHUB") addr = APP.Functions.parse_socket_address ( APP.BE.CLI.server_address ) try: os.unlink (addr) except: pass self.logger( "Starting. Listening on {0}".format (addr) ) Listener.__init__(self, addr) self.queue = ThreadingQueue.Queue(1024) self.workers = [CLIWorker(self.queue, self.logger) for i in range(0,5)]
def __init__(self, *args, **kwargs): Listener.__init__(self, *args, **kwargs) # multiprocessing tries to call unlink even on abstract # named sockets, prevent it from doing so. self._listener._unlink.cancel() # Prevent child processes from inheriting this socket # If we dont do this child processes not created by calibre, will # inherit this socket, preventing the calibre GUI from being restarted. # Examples of such processes are external viewers launched by Qt # using openUrl(). fd = self._listener._socket.fileno() old_flags = fcntl.fcntl(fd, fcntl.F_GETFD) fcntl.fcntl(fd, fcntl.F_SETFD, old_flags | fcntl.FD_CLOEXEC)
def __init__(self): from app import APP self.logger = APP.LoggingClient(name="UIHUB") addr = APP.Functions.parse_socket_address(APP.BE.CLI.server_address) try: os.unlink(addr) except: pass self.logger("Starting. Listening on {0}".format(addr)) Listener.__init__(self, addr) self.queue = ThreadingQueue.Queue(1024) self.workers = [ CLIWorker(self.queue, self.logger) for i in range(0, 5) ]
def __init__(self, *args, **kwargs): Listener.__init__(self, *args, **kwargs) # multiprocessing tries to call unlink even on abstract # named sockets, prevent it from doing so. self._listener._unlink.cancel()
def __init__(self): Listener.__init__(self, 'AF_PIPE') self.establish_connection_to_close_lock = thread.allocate_lock()
def __init__(self, address, family): Listener.__init__(self, family) self.__address = address self.lock = thread.allocate_lock()
def __init__(self, *args, **kwargs): Listener.__init__(self, *args, **kwargs) # multiprocessing tries to call unlink even on abstract # named sockets, prevent it from doing so. self._listener._unlink.cancel()