diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
commit | 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 (patch) | |
tree | e076082f6cb799a820eee287c47f24f082b3a41c /module/plugins/hooks/UpdateManager.py | |
parent | [DDLMusicOrg] Removed (diff) | |
download | pyload-7beb65e991bc6d1913c3b5bb2ef69e659d5b8342.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module/plugins/hooks/UpdateManager.py')
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index a0b044edb..45d666f45 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -46,13 +46,13 @@ class UpdateManager(Hook): SERVER_URL = "http://updatemanager.pyload.org" VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') - MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) + MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours def pluginConfigChanged(self, plugin, name, value): if name == "interval": interval = value * 60 * 60 - if self.MIN_INTERVAL <= interval != self.interval: + if self.MIN_CHECK_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() @@ -67,8 +67,8 @@ class UpdateManager(Hook): def coreReady(self): - self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) - x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) + x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig('reloadplugins')) self.core.scheduler.addJob(10, x, threaded=False) @@ -78,7 +78,7 @@ class UpdateManager(Hook): def setup(self): self.cb2 = None - self.interval = self.MIN_INTERVAL + self.interval = self.MIN_CHECK_INTERVAL self.updating = False self.info = {'pyload': False, 'version': None, 'plugins': False} self.mtimes = {} #: store modification time for each plugin @@ -122,7 +122,7 @@ class UpdateManager(Hook): def periodical(self): - if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug): + if not self.info['pyload'] and not (self.getConfig('nodebugupdate') and self.core.debug): self.updateThread() @@ -138,9 +138,9 @@ class UpdateManager(Hook): def updateThread(self): self.updating = True - status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") + status = self.update(onlyplugin=self.getConfig('mode') == "plugins only") - if status is 2 and self.getConfig("autorestart"): + if status is 2 and self.getConfig('autorestart'): self.core.api.restart() else: self.updating = False |