Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
	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)
Ejemplo n.º 4
0
 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)