Merge lp:~ralsina/ubuntu-sso-client/find_exes into lp:ubuntu-sso-client

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 924
Merged at revision: 925
Proposed branch: lp:~ralsina/ubuntu-sso-client/find_exes
Merge into: lp:ubuntu-sso-client
Diff against target: 40 lines (+11/-4)
2 files modified
ubuntu_sso/__init__.py (+6/-0)
ubuntu_sso/utils/__init__.py (+5/-4)
To merge this branch: bzr merge lp:~ralsina/ubuntu-sso-client/find_exes
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
Natalia Bidart (community) Approve
Brian Curtin (community) Approve
Review via email: mp+98108@code.launchpad.net

Commit message

- Added .exe to the constant for binary names if needed (LP: #958778)

Description of the change

fix paths and spawning on windows

To post a comment you must log in.
Revision history for this message
Manuel de la Peña (mandel) wrote :

We should add tests fit this since we already had problems with get_bin due to the lack of tests. What about patching sys.platform and test the result?

Also, I think I'd a good idea to set the gtk one to none on windows to make the error more clear.

review: Needs Fixing
Revision history for this message
Roberto Alsina (ralsina) wrote :

> We should add tests fit this since we already had problems with get_bin due to
> the lack of tests. What about patching sys.platform and test the result?
>
> Also, I think I'd a good idea to set the gtk one to none on windows to make
> the error more clear.

This already had tests, I added them in a branch on friday.

The only functional change in this branch are the constants for binary names, the other is just a cosmetic fix.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good! Though I'm getting:

ubuntu_sso/__init__.py:
    42: [W0311] Bad indentation. Found 3 spaces, expected 4
    43: [W0311] Bad indentation. Found 3 spaces, expected 4

review: Needs Fixing
Revision history for this message
Roberto Alsina (ralsina) wrote :

> Looks good! Though I'm getting:
>
> ubuntu_sso/__init__.py:
> 42: [W0311] Bad indentation. Found 3 spaces, expected 4
> 43: [W0311] Bad indentation. Found 3 spaces, expected 4

Fixed in revno924, thanks!

924. By Roberto Alsina

pep8 fix

Revision history for this message
Brian Curtin (brian.curtin) wrote :

looks good

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Revision history for this message
Manuel de la Peña (mandel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu_sso/__init__.py'
--- ubuntu_sso/__init__.py 2012-03-08 12:35:25 +0000
+++ ubuntu_sso/__init__.py 2012-03-19 14:18:18 +0000
@@ -15,6 +15,8 @@
15# with this program. If not, see <http://www.gnu.org/licenses/>.15# with this program. If not, see <http://www.gnu.org/licenses/>.
16"""Ubuntu Single Sign On client code."""16"""Ubuntu Single Sign On client code."""
1717
18import sys
19
18# DBus constants20# DBus constants
19DBUS_BUS_NAME = "com.ubuntu.sso"21DBUS_BUS_NAME = "com.ubuntu.sso"
2022
@@ -35,3 +37,7 @@
35UI_EXECUTABLE_GTK = 'ubuntu-sso-login-gtk'37UI_EXECUTABLE_GTK = 'ubuntu-sso-login-gtk'
36UI_EXECUTABLE_QT = 'ubuntu-sso-login-qt'38UI_EXECUTABLE_QT = 'ubuntu-sso-login-qt'
37UI_PROXY_CREDS_DIALOG = 'ubuntu-sso-proxy-creds-qt'39UI_PROXY_CREDS_DIALOG = 'ubuntu-sso-proxy-creds-qt'
40
41if getattr(sys, "frozen", None) is not None and sys.platform == "win32":
42 UI_EXECUTABLE_QT += ".exe"
43 UI_PROXY_CREDS_DIALOG += ".exe"
3844
=== modified file 'ubuntu_sso/utils/__init__.py'
--- ubuntu_sso/utils/__init__.py 2012-03-16 22:33:29 +0000
+++ ubuntu_sso/utils/__init__.py 2012-03-19 14:18:18 +0000
@@ -96,12 +96,13 @@
96 """96 """
97 # If sys is frozen, this is an .exe, and all binaries are in97 # If sys is frozen, this is an .exe, and all binaries are in
98 # the same place98 # the same place
99 if hasattr(sys, "frozen"):99 if getattr(sys, "frozen", None) is not None:
100 exec_path = os.path.abspath(sys.executable)100 exec_path = os.path.abspath(sys.executable)
101 return os.path.dirname(exec_path)101 result = os.path.dirname(exec_path)
102102 else:
103 result = _get_dir(dir_name=BIN_SUFFIX, dir_constant='BIN_DIR')103 result = _get_dir(dir_name=BIN_SUFFIX, dir_constant='BIN_DIR')
104 assert result is not None, '%r dir can not be None.' % BIN_SUFFIX104 assert result is not None, '%r dir can not be None.' % BIN_SUFFIX
105 logger.info('get_bin_dir: returning dir located at %r.', result)
105 return result106 return result
106107
107108

Subscribers

People subscribed via source and target branches