~alecu/ubuntuone-client/proxy-tunnel-server

« back to all changes in this revision

Viewing changes to ubuntuone/platform/credentials/linux.py

  • Committer: Alejandro J. Cura
  • Date: 2012-03-06 00:30:33 UTC
  • mfrom: (1196.1.3 ubuntuone-client)
  • Revision ID: alecu@canonical.com-20120306003033-smfft1tfg4purnpx
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import dbus.service
21
21
import ubuntu_sso
22
22
 
23
 
from ubuntu_sso.credentials import (
24
 
    HELP_TEXT_KEY,
25
 
    PING_URL_KEY,
26
 
    TC_URL_KEY,
27
 
)
28
23
from ubuntuone.platform.credentials import (
29
24
    APP_NAME,
30
 
    DESCRIPTION,
31
25
    logger,
32
26
    NO_OP,
33
 
    PING_URL,
34
 
    TC_URL,
 
27
    UI_PARAMS,
35
28
)
36
29
 
37
30
 
227
220
    def register(self, args, reply_handler=NO_OP, error_handler=NO_OP):
228
221
        """Get credentials if found else prompt to register to Ubuntu One."""
229
222
        self.ref_count += 1
230
 
        params = {HELP_TEXT_KEY: DESCRIPTION, TC_URL_KEY: TC_URL,
231
 
                  PING_URL_KEY: PING_URL}
 
223
        params = dict(UI_PARAMS)
232
224
        params.update(args)
233
225
        self.sso_proxy.register(APP_NAME, params,
234
226
            reply_handler=reply_handler, error_handler=error_handler)
239
231
    def login(self, args, reply_handler=NO_OP, error_handler=NO_OP):
240
232
        """Get credentials if found else prompt to login to Ubuntu One."""
241
233
        self.ref_count += 1
242
 
        params = {HELP_TEXT_KEY: DESCRIPTION, TC_URL_KEY: TC_URL,
243
 
                  PING_URL_KEY: PING_URL}
 
234
        params = dict(UI_PARAMS)
244
235
        params.update(args)
245
236
        self.sso_proxy.login(APP_NAME, params,
246
237
            reply_handler=reply_handler, error_handler=error_handler)
249
240
                         in_signature='a{ss}',
250
241
                         async_callbacks=("reply_handler", "error_handler"))
251
242
    def login_email_password(self, args, reply_handler=NO_OP,
252
 
    error_handler=NO_OP):
 
243
                             error_handler=NO_OP):
253
244
        """Get credentials if found else prompt to login to Ubuntu One."""
254
245
        self.ref_count += 1
255
 
        params = {PING_URL_KEY: PING_URL}
 
246
        params = dict(UI_PARAMS)
256
247
        params.update(args)
257
248
        self.sso_proxy.login_email_password(APP_NAME, params,
258
249
            reply_handler=reply_handler, error_handler=error_handler)