From 0f46b4f59fbcadd3a25cab75a1fc19fea07e02b0 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Fri, 14 Aug 2009 01:51:17 +0200 Subject: python stuff: default to /var/run/usbmuxd on linux and make it configurable --- python-client/tcprelay.py | 3 ++- python-client/usbmux.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python-client/tcprelay.py b/python-client/tcprelay.py index c49d708..2874ae1 100644 --- a/python-client/tcprelay.py +++ b/python-client/tcprelay.py @@ -68,7 +68,7 @@ class SocketRelay(object): class TCPRelay(SocketServer.BaseRequestHandler): def handle(self): print "Incoming connection to %d"%self.server.server_address[1] - mux = usbmux.USBMux() + mux = usbmux.USBMux(options.sockpath) print "Waiting for devices..." if not mux.devices: mux.process(1.0) @@ -100,6 +100,7 @@ HOST = "localhost" parser = OptionParser(usage="usage: %prog [OPTIONS] RemotePort[:LocalPort] [RemotePort[:LocalPort]]...") parser.add_option("-t", "--threaded", dest='threaded', action='store_true', default=False, help="use threading to handle multiple connections at once") parser.add_option("-b", "--bufsize", dest='bufsize', action='store', metavar='KILOBYTES', type='int', default=128, help="specify buffer size for socket forwarding") +parser.add_option("-s", "--socket", dest='sockpath', action='store', metavar='PATH', type='str', default=None, help="specify the path of the usbmuxd socket") options, args = parser.parse_args() diff --git a/python-client/usbmux.py b/python-client/usbmux.py index 8b0270d..47112d3 100644 --- a/python-client/usbmux.py +++ b/python-client/usbmux.py @@ -214,7 +214,7 @@ class USBMux(object): if sys.platform == 'darwin': socketpath = "/var/run/usbmuxd" else: - socketpath = "/tmp/usbmuxd" + socketpath = "/var/run/usbmuxd" self.socketpath = socketpath self.listener = MuxConnection(socketpath, BinaryProtocol) try: -- cgit v1.1-32-gdbae