~nataliabidart/ubuntuone-client/async-credentials

« back to all changes in this revision

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

  • Committer: Natalia B. Bidart
  • Date: 2011-02-15 18:19:18 UTC
  • Revision ID: natalia.bidart@canonical.com-20110215181918-rlrcxd5pncyqcle1
Making tests not leavin dbus stuff behind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
logger = logging.getLogger("ubuntuone.SyncDaemon.DBus")
62
62
 
63
63
 
64
 
try:
65
 
    from ubuntuone import clientdefs
66
 
    APP_NAME = clientdefs.APP_NAME
67
 
    TC_URL = clientdefs.TC_URL
68
 
    PING_URL = clientdefs.PING_URL
69
 
    DESCRIPTION = clientdefs.DESCRIPTION
70
 
except ImportError:
71
 
    APP_NAME = "Ubuntu One (ImportError mode)"
72
 
    TC_URL = "https://one.ubuntu.com/terms/"
73
 
    PING_URL = "https://one.ubuntu.com/oauth/sso-finished-so-get-tokens/"
74
 
    DESCRIPTION = "Stub used since the real values can't be imported."
75
 
    logger.warning('Can not import APP_NAME, TC_URL, PING_URL, DESCRIPTION.'
76
 
                   'Using stub values (%s, %s, %s, %s).',
77
 
                   APP_NAME, TC_URL, PING_URL, DESCRIPTION)
78
 
 
79
 
 
80
64
class NoAccessToken(Exception):
81
65
    """The access token could not be retrieved."""
82
66
 
1988
1972
                iface.find_credentials(reply_handler=lambda: None,
1989
1973
                                       error_handler=error_handler)
1990
1974
            else:
1991
 
                iface.register(reply_handler=lambda: None,
 
1975
                iface.register({'window_id': '0'},  # no window ID
 
1976
                               reply_handler=lambda: None,
1992
1977
                               error_handler=error_handler)
1993
1978
        except DBusException, e:
1994
1979
            error_handler(e)