diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-28 00:45:36 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-28 00:45:36 +0100 |
commit | e60aecc0973c21a22807b3eb16023e64efcbb503 (patch) | |
tree | c862e75b9c5f342578d56fb0f5aaf6b95175a981 | |
parent | Merge pull request #1294 from ludoviclehmann/stable (diff) | |
download | pyload-e60aecc0973c21a22807b3eb16023e64efcbb503.tar.xz |
[MultiHook] Periodically loadAccount
-rw-r--r-- | module/plugins/internal/MultiHook.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py index 5855f7ece..291063268 100644 --- a/module/plugins/internal/MultiHook.py +++ b/module/plugins/internal/MultiHook.py @@ -10,7 +10,7 @@ from module.utils import decode, remove_chars class MultiHook(Hook): __name__ = "MultiHook" __type__ = "hook" - __version__ = "0.40" + __version__ = "0.41" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -66,10 +66,10 @@ class MultiHook(Hook): self.pluginname = None self.plugintype = None - self._initPlugin() + self.initPlugin() - def _initPlugin(self): + def initPlugin(self): plugin, type = self.core.pluginManager.findPlugin(self.__name__) if not plugin: @@ -82,7 +82,7 @@ class MultiHook(Hook): self.pluginclass = getattr(self.pluginmodule, self.__name__) - def _loadAccount(self): + def loadAccount(self): self.account = self.core.accountManager.getAccountPlugin(self.pluginname) if self.account and not self.account.canUse(): @@ -93,10 +93,6 @@ class MultiHook(Hook): self.setConfig('activated', False) - def coreReady(self): - self._loadAccount() - - def getURL(self, *args, **kwargs): #@TODO: Remove in 0.4.10 """ see HTTPRequest for argument list """ h = pyreq.getHTTPRequest(timeout=120) @@ -199,6 +195,8 @@ class MultiHook(Hook): def periodical(self): """reload plugin list periodically""" + self.loadAccount() + if self.getConfig("reload", True): self.interval = max(self.getConfig("reloadinterval", 12) * 60 * 60, self.MIN_RELOAD_INTERVAL) else: |