~dobey/ubuntuone-client/fix-test-fails

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/tunnel_runner.py

  • Committer: Tarmac
  • Author(s): Alejandro J. Cura
  • Date: 2012-03-30 15:59:38 UTC
  • mfrom: (1217.1.2 fix-broken-tunnel)
  • Revision ID: tarmac-20120330155938-qt2fa0q7cb25eqnd
- Do not use the Qt Dbus mainloop on Windows (LP: #969150).
- Force using the system proxy on Windows (LP: #969157).

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from os import path
22
22
 
23
23
from twisted.internet import defer, reactor
 
24
from twisted.python import procutils
24
25
 
25
26
from ubuntuone.platform.constants import TUNNEL_EXECUTABLE
26
27
 
48
49
        from ubuntuone.proxy.tunnel_client import TunnelProcessProtocol
49
50
        protocol = TunnelProcessProtocol(self.client_d)
50
51
        process_path = self.get_process_path()
51
 
        args = [TUNNEL_EXECUTABLE, host, str(port)]
52
 
        self.process_transport = reactor.spawnProcess(protocol, process_path,
 
52
        args = [process_path, host, str(port)]
 
53
        if sys.platform.startswith("win") and not process_path.endswith("exe"):
 
54
            python_exe = procutils.which("python.exe")
 
55
            if python_exe:
 
56
                args.insert(0, python_exe[0])
 
57
        self.process_transport = reactor.spawnProcess(protocol, args[0],
53
58
                                                      env=None, args=args)
54
59
        reactor.addSystemEventTrigger("before", "shutdown", self.stop)
55
60