From 32de242760a3b0dddb8f3c5a19ad961aa75c65d8 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 20 May 2012 13:24:34 +0200 Subject: [PATCH] Desktop updater --- couchpotato/core/_base/updater/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index eacc993a..0d7b04f6 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -338,7 +338,7 @@ class SourceUpdater(BaseUpdater): return {} -class DesktopUpdater(Plugin): +class DesktopUpdater(BaseUpdater): version = None update_failed = False @@ -350,9 +350,15 @@ class DesktopUpdater(Plugin): def doUpdate(self): try: - self.desktop.CheckForUpdate(silentUnlessUpdate = True) + def do_restart(e): + if e['status'] == 'done': + fireEventAsync('app.restart') + else: + log.error('Failed updating desktop: %s' % e['exception']) + self.update_failed = True + + self.desktop._esky.auto_update(callback = do_restart) except: - log.error('Failed updating desktop: %s' % traceback.format_exc()) self.update_failed = True return False