Merge lp:~mikemc/ubuntu-sso-client/fix-1018924-use-buildout-python into lp:ubuntu-sso-client

Proposed by Mike McCracken on 2012-06-29
Status: Rejected
Rejected by: dobey on 2012-07-06
Proposed branch: lp:~mikemc/ubuntu-sso-client/fix-1018924-use-buildout-python
Merge into: lp:ubuntu-sso-client
Diff against target: 102 lines (+37/-15)
4 files modified
run-mac-tests (+1/-1)
ubuntu_sso/main/darwin.py (+19/-9)
ubuntu_sso/main/windows.py (+14/-4)
ubuntu_sso/utils/tcpactivation.py (+3/-1)
To merge this branch: bzr merge lp:~mikemc/ubuntu-sso-client/fix-1018924-use-buildout-python
Reviewer Review Type Date Requested Status
dobey (community) 2012-06-29 Disapprove on 2012-07-06
Review via email: mp+112813@code.launchpad.net

Commit Message

- Use buildout python when running from source on darwin and windows. (LP: #1018924)

Description of the Change

- Use buildout python when running from source on darwin and windows. (LP: #1018924)

To post a comment you must log in.
dobey (dobey) wrote :

I don't think there should be any specific references to ubuntuone-client in ubuntu-sso-client. There are independent. Why would they be needed here exactly?

review: Needs Information
dobey (dobey) :
review: Disapprove

Unmerged revisions

983. By Mike McCracken on 2012-06-29

Make Windows tcpactivation only use registry for executable search when frozen.

982. By Mike McCracken on 2012-06-29

Tag as fixing (LP: #1018924)

981. By Mike McCracken on 2012-06-29

Use buildout python to run subprocesses during development. (LP: #1018924)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-mac-tests'
2--- run-mac-tests 2012-05-01 11:56:52 +0000
3+++ run-mac-tests 2012-06-29 16:55:21 +0000
4@@ -48,7 +48,7 @@
5 }
6
7 echo "*** Running QT test suite for ""$MODULE"" ***"
8-./setup.py build
9+python ./setup.py build
10 python $u1trial --reactor=qt4 --gui -p "$GTK_TESTS_PATH" -i "test_gui.py, test_linux.py, test_qt.py, test_windows.py, test_glib.py, test_txsecrets.py" "$MODULE"
11 rm -rf _trial_temp
12 rm -rf build
13
14=== modified file 'ubuntu_sso/main/darwin.py'
15--- ubuntu_sso/main/darwin.py 2012-05-21 14:38:23 +0000
16+++ ubuntu_sso/main/darwin.py 2012-06-29 16:55:21 +0000
17@@ -48,6 +48,8 @@
18 logger = setup_logging("ubuntu_sso.main.darwin")
19 SSO_INSTALL_PATH = 'SSOInstallPath'
20
21+SD_SERVICE_NAME = 'ubuntuone-syncdaemon'
22+
23
24 def get_sso_domain_socket():
25 """Compute the domain socket for the sso ipc."""
26@@ -59,15 +61,23 @@
27 """Find the path to the executable callback."""
28 # TODO: We have to either use launchd to launch the different services
29 # on demand or us LaunchServices to handle running the app via an URL.
30- ubuntu_sso_pkg_dir = os.path.dirname(os.path.dirname(ubuntu_sso.__file__))
31- ubuntu_sso_bin_dir = os.path.join(ubuntu_sso_pkg_dir, 'bin')
32- ubuntu_sso_bin = os.path.join(ubuntu_sso_bin_dir, 'ubuntu-sso-login')
33- ubuntuone_client_bin_dir = os.path.join(ubuntu_sso_pkg_dir,
34- '../ubuntuone-client/bin')
35- ubuntuone_client_bin = os.path.join(ubuntuone_client_bin_dir, name)
36- if os.path.exists(ubuntuone_client_bin):
37- return ubuntuone_client_bin
38- return ubuntu_sso_bin
39+
40+ module_filename = ubuntu_sso.__file__
41+ ubuntu_sso_pkg_dir = os.path.dirname(os.path.dirname(module_filename))
42+
43+ if name == SSO_SERVICE_NAME:
44+ ubuntu_sso_bin_dir = os.path.join(ubuntu_sso_pkg_dir, 'bin')
45+ ubuntu_sso_bin = os.path.join(ubuntu_sso_bin_dir, 'ubuntu-sso-login')
46+ return "python " + ubuntu_sso_bin
47+
48+ elif name == SD_SERVICE_NAME:
49+ ubuntuone_client_bin_dir = os.path.join(ubuntu_sso_pkg_dir,
50+ '../ubuntuone-client/bin')
51+ ubuntuone_client_bin = os.path.join(ubuntuone_client_bin_dir, name)
52+ return "python " + ubuntuone_client_bin
53+
54+ else:
55+ raise Exception("unknown service name %r" % name)
56
57
58 class DescriptionFactory(object):
59
60=== modified file 'ubuntu_sso/main/windows.py'
61--- ubuntu_sso/main/windows.py 2012-06-27 20:16:56 +0000
62+++ ubuntu_sso/main/windows.py 2012-06-29 16:55:21 +0000
63@@ -86,10 +86,20 @@
64
65 def get_activation_cmdline(name):
66 """Find the path to the executable callback."""
67- key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, U1_REG_PATH)
68- # pylint: disable=W0612
69- value, registry_type = winreg.QueryValueEx(key, "path-" + name)
70- return value
71+ if getattr(sys, "frozen", None) is not None:
72+ key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, U1_REG_PATH)
73+ # pylint: disable=W0612
74+ value, registry_type = winreg.QueryValueEx(key, "path-" + name)
75+ return value
76+
77+ else:
78+ dirname = os.path.dirname(sys.argv[0])
79+ if name == SSO_SERVICE_NAME:
80+ exe_name = 'ubuntu-sso-login'
81+ else:
82+ exe_name = 'ubuntuone-syncdaemon'
83+ value = os.path.join(dirname, exe_name)
84+ return "python " + value
85
86
87 class DescriptionFactory(object):
88
89=== modified file 'ubuntu_sso/utils/tcpactivation.py'
90--- ubuntu_sso/utils/tcpactivation.py 2012-06-28 21:55:43 +0000
91+++ ubuntu_sso/utils/tcpactivation.py 2012-06-29 16:55:21 +0000
92@@ -151,7 +151,9 @@
93 # Without using close_fds=True, strange things happen
94 # with logging on windows. More information at
95 # http://bugs.python.org/issue4749
96- subprocess.Popen(self.config.command_line, close_fds=True)
97+ subprocess.Popen(self.config.command_line,
98+ close_fds=True,
99+ shell=True)
100
101 @defer.inlineCallbacks
102 def _do_get_active_description(self):

Subscribers

People subscribed via source and target branches