~mfoord/ubuntu-sso-client/password-policy-error

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/sso_wizard_page.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2013-06-12 16:04:29 UTC
  • mfrom: (1032.1.1 move-u1-constants)
  • Revision ID: tarmac-20130612160429-urm7ew2ox33oj4a0
Move the U1 SSO constants values to constants.py.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
# files in the program, then also delete it here.
29
29
"""Qt implementation of the UI."""
30
30
 
31
 
import platform
32
 
import urllib
33
 
 
34
31
from functools import wraps
35
32
 
36
33
# pylint: disable=F0401,E0611
47
44
)
48
45
from twisted.internet import defer
49
46
 
50
 
from ubuntu_sso import constants, main, SSO_UONE_BASE_URL
 
47
from ubuntu_sso import main
 
48
from ubuntu_sso.constants import APP_NAME, TC_URL, POLICY_URL, PING_URL
51
49
from ubuntu_sso.logger import setup_gui_logging, log_call
52
50
from ubuntu_sso.qt import (
53
51
    ERROR_STYLE,
61
59
logger = setup_gui_logging('ubuntu_sso.sso_wizard_page')
62
60
 
63
61
 
64
 
def 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
 
 
74
 
APP_NAME = u"Ubuntu One"
75
 
TC_URL = u"%s/terms/" % SSO_UONE_BASE_URL
76
 
POLICY_URL = u"%s/privacy/" % SSO_UONE_BASE_URL
77
 
BASE_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
80
 
PING_URL = BASE_PING_URL + u"?" + platform_data().decode('ascii')
81
 
 
82
 
 
83
62
class WizardHeader(QFrame):
84
63
    """WizardHeader Class for Title and Subtitle in all wizard pages."""
85
64