Merge lp:~dobey/ubuntu-sso-client/update-13-10 into lp:ubuntu-sso-client/stable-13-10

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: no longer in the source branch.
Merged at revision: 1033
Proposed branch: lp:~dobey/ubuntu-sso-client/update-13-10
Merge into: lp:ubuntu-sso-client/stable-13-10
Diff against target: 85 lines (+26/-23)
2 files modified
ubuntu_sso/constants.py.in (+24/-0)
ubuntu_sso/qt/sso_wizard_page.py (+2/-23)
To merge this branch: bzr merge lp:~dobey/ubuntu-sso-client/update-13-10
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Review via email: mp+172886@code.launchpad.net

Commit message

[Rodney Dawes]

    Move the U1 SSO constants values to constants.py.in.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
1033. By dobey

[Rodney Dawes]

    Move the U1 SSO constants values to constants.py.in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/constants.py.in'
2--- ubuntu_sso/constants.py.in 2013-03-21 15:28:30 +0000
3+++ ubuntu_sso/constants.py.in 2013-07-03 19:53:25 +0000
4@@ -33,8 +33,32 @@
5 """
6
7 import os
8+import platform
9+import urllib
10+
11+from ubuntu_sso import SSO_UONE_BASE_URL
12
13 VERSION = '@VERSION@'
14 PROJECT_NAME = '@PROJECT_NAME@'
15 PROJECT_DIR = os.path.join('@prefix@', 'share', PROJECT_NAME)
16 BIN_DIR = os.path.join('@prefix@', 'lib', PROJECT_NAME)
17+
18+# Ubuntu One sso constants
19+APP_NAME = u"Ubuntu One"
20+TC_URL = u"%s/terms/" % SSO_UONE_BASE_URL
21+POLICY_URL = u"%s/privacy/" % SSO_UONE_BASE_URL
22+BASE_PING_URL = \
23+ u"%s/oauth/sso-finished-so-get-tokens/{email}" % SSO_UONE_BASE_URL
24+
25+
26+def platform_data():
27+ result = {'platform': platform.system(),
28+ 'platform_version': platform.release(),
29+ 'platform_arch': platform.machine(),
30+ 'client_version': VERSION}
31+ # urlencode will not encode unicode, only bytes
32+ result = urllib.urlencode(result)
33+ return result
34+
35+# the result of platform_data is given by urlencode, encoded with ascii
36+PING_URL = BASE_PING_URL + u"?" + platform_data().decode('ascii')
37
38=== modified file 'ubuntu_sso/qt/sso_wizard_page.py'
39--- ubuntu_sso/qt/sso_wizard_page.py 2013-04-19 15:32:17 +0000
40+++ ubuntu_sso/qt/sso_wizard_page.py 2013-07-03 19:53:25 +0000
41@@ -28,9 +28,6 @@
42 # files in the program, then also delete it here.
43 """Qt implementation of the UI."""
44
45-import platform
46-import urllib
47-
48 from functools import wraps
49
50 # pylint: disable=F0401,E0611
51@@ -47,7 +44,8 @@
52 )
53 from twisted.internet import defer
54
55-from ubuntu_sso import constants, main, SSO_UONE_BASE_URL
56+from ubuntu_sso import main
57+from ubuntu_sso.constants import APP_NAME, TC_URL, POLICY_URL, PING_URL
58 from ubuntu_sso.logger import setup_gui_logging, log_call
59 from ubuntu_sso.qt import (
60 ERROR_STYLE,
61@@ -61,25 +59,6 @@
62 logger = setup_gui_logging('ubuntu_sso.sso_wizard_page')
63
64
65-def platform_data():
66- result = {'platform': platform.system(),
67- 'platform_version': platform.release(),
68- 'platform_arch': platform.machine(),
69- 'client_version': constants.VERSION}
70- # urlencode will not encode unicode, only bytes
71- result = urllib.urlencode(result)
72- return result
73-
74-
75-APP_NAME = u"Ubuntu One"
76-TC_URL = u"%s/terms/" % SSO_UONE_BASE_URL
77-POLICY_URL = u"%s/privacy/" % SSO_UONE_BASE_URL
78-BASE_PING_URL = \
79- u"%s/oauth/sso-finished-so-get-tokens/{email}" % SSO_UONE_BASE_URL
80-# the result of platform_data is given by urlencode, encoded with ascii
81-PING_URL = BASE_PING_URL + u"?" + platform_data().decode('ascii')
82-
83-
84 class WizardHeader(QFrame):
85 """WizardHeader Class for Title and Subtitle in all wizard pages."""
86

Subscribers

People subscribed via source and target branches

to all changes: