Example #1
0
def handle_update():
    from Settings.Updaters import getUpdater
    updater = getUpdater()
    if updater and updater.ShouldAutoUpdate():
        (update_is_waiting, update_path) = \
            updater.UpdateFileIsWaitingInDirectory()
        if update_is_waiting:
            updater.ApplyUpdate(update_path)
Example #2
0
 def doUpdateCheck(self):
     """ Will run the whole flow for update, Return None. """
     updater = getUpdater()
     if updater and updater.ShouldCheckUpdates():
         (_is_latest, _latest_ver, _latest_url) = updater.IsLatestVersion()
         if not _is_latest:
             if updater.ShouldAutoUpdate() and _latest_url:
                 if updater.DownloadUpdate(_latest_url, _latest_ver):
                     WriteDebug('Update zip downloaded, restarting!')
                     restart()
             elif not updater.ShouldAutoUpdate() and _latest_url:
                 getInteractor().notifyNewVersion\
                     (updater.CurrentVersion(), _latest_ver, _latest_url)