~nataliabidart/ubuntuone-windows-installer/stable-3-0-update-2.99.2

« back to all changes in this revision

Viewing changes to ubuntuone_installer/gui/qt/utils/windows.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-11-12 02:00:31 UTC
  • mfrom: (85.1.5 import-qt4reactor)
  • Revision ID: tarmac-20111112020031-gvj3ise8dpm2xs7g
- Import qt4reactor properly (LP: #888722).

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
from ubuntuone.platform import tools
43
43
# pylint: enable=E0611
44
44
 
45
 
from ubuntuone.platform.credentials import CredentialsManagementTool
 
45
from ubuntuone_installer.logger import setup_logging
 
46
 
 
47
 
 
48
logger = setup_logging('qt.utils.windows')
46
49
 
47
50
AUTORUN_KEY = r"Software\Microsoft\Windows\CurrentVersion\Run"
48
51
 
102
105
 
103
106
 
104
107
@defer.inlineCallbacks
105
 
def check_credentials(gui, logger, success_cb, error_cb,
106
 
                      installer=False):
107
 
    """Check credentials and either start u1cp or show the wizard."""
108
 
    credtool = CredentialsManagementTool()
109
 
    # pylint: disable=W0703
110
 
    try:
111
 
        creds = yield credtool.find_credentials()
112
 
    except Exception, exc:
113
 
        error_cb(exc, logger)
114
 
    else:
115
 
        yield success_cb(creds, gui, installer, logger, start_control_panel,
116
 
                         check_updates)
117
 
 
118
 
 
119
 
@defer.inlineCallbacks
120
 
def are_updates_present(logger):
 
108
def are_updates_present():
121
109
    """Return if there are updates for Ubuntu One."""
122
110
    update_path = _get_update_path()
123
111
    logger.debug('Update path %s', update_path)
145
133
 
146
134
 
147
135
@defer.inlineCallbacks
148
 
def check_updates(gui, logger):
 
136
def check_updates(gui):
149
137
    """Check for updates."""
150
138
    logger.info('Checking for updates.')
151
139
    # the idea is simple, check if there are updates, ask user if we perform
152
140
    # the update and continue.
153
 
    are_present = yield are_updates_present(logger)
 
141
    are_present = yield are_updates_present()
154
142
    logger.debug('Updates present: %r', are_updates_present)
155
143
    if are_present:
156
144
        logger.info('Updates are present.')