Merge lp:~dobey/ubuntu-sso-client/move-u1-constants into lp:ubuntu-sso-client

Proposed by dobey
Status: Merged
Approved by: Brian Curtin
Approved revision: 1033
Merged at revision: 1033
Proposed branch: lp:~dobey/ubuntu-sso-client/move-u1-constants
Merge into: lp:ubuntu-sso-client
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/move-u1-constants
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+168962@code.launchpad.net

Commit message

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
Revision history for this message
Brian Curtin (brian.curtin) wrote :

Looks fine, and tests pass on Windows

review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches