def connect_to_daemon(): """ Returns socket connected to daemon or None if connection failed. Outputs error message in later case. """ import socket from scc.paths import get_daemon_socket try: s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.connect(get_daemon_socket()) except Exception, e: print >> sys.stderr, "Connection to scc-daemon failed: %s" % (e, ) return None
def connect_to_daemon(): """ Returns socket connected to daemon or None if connection failed. Outputs error message in later case. """ import socket from scc.paths import get_daemon_socket try: s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.connect(get_daemon_socket()) except Exception, e: print >>sys.stderr, "Connection to scc-daemon failed: %s" % (e, ) return None
def _connect(self): if self.connecting : return self.connecting = True sc = Gio.SocketClient() address = Gio.UnixSocketAddress.new(get_daemon_socket()) sc.connect_async(address, None, self._on_connected)
def _connect(self): if self.connecting: return self.connecting = True sc = Gio.SocketClient() address = Gio.UnixSocketAddress.new(get_daemon_socket()) sc.connect_async(address, None, self._on_connected)