From ea9e9a8c9024c37234eb0fdb79c8d4770c39d9cb Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 1 May 2012 07:35:27 +0200 Subject: [PATCH] Updater base --- couchpotato/core/_base/updater/main.py | 33 +++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index bbee05dc..d6683648 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -21,7 +21,9 @@ class Updater(Plugin): def __init__(self): - if os.path.isdir(os.path.join(Env.get('app_dir'), '.git')): + if Env.get('desktop'): + self.updater = DesktopUpdater() + elif os.path.isdir(os.path.join(Env.get('app_dir'), '.git')): self.updater = GitUpdater(self.conf('git_command', default = 'git')) else: self.updater = SourceUpdater() @@ -333,3 +335,32 @@ class SourceUpdater(BaseUpdater): log.error('Failed getting latest request from github: %s' % traceback.format_exc()) return {} + + +class DesktopUpdater(Plugin): + + version = None + update_failed = False + update_version = None + last_check = 0 + + def __init__(self): + self.desktop = Env.get('desktop') + + def doUpdate(self): + pass + + def info(self): + return { + 'last_check': self.last_check, + 'update_version': self.update_version, + 'version': self.getVersion(), + 'branch': 'desktop_build', + } + + def check(self): + pass + + def getVersion(self): + return {} +