diff options
Diffstat (limited to 'pyload/plugin/internal')
-rw-r--r-- | pyload/plugin/internal/BasePlugin.py | 5 | ||||
-rw-r--r-- | pyload/plugin/internal/MultiHook.py | 30 | ||||
-rw-r--r-- | pyload/plugin/internal/MultiHoster.py | 2 |
3 files changed, 10 insertions, 27 deletions
diff --git a/pyload/plugin/internal/BasePlugin.py b/pyload/plugin/internal/BasePlugin.py index ed4da72a1..0b6e8f102 100644 --- a/pyload/plugin/internal/BasePlugin.py +++ b/pyload/plugin/internal/BasePlugin.py @@ -6,7 +6,7 @@ from urllib import unquote from urlparse import urljoin, urlparse from pyload.network.HTTPRequest import BadHeader -from pyload.plugin.internal.SimpleHoster import create_getInfo, getFileURL +from pyload.plugin.internal.SimpleHoster import getFileURL from pyload.plugin.Hoster import Hoster @@ -99,6 +99,3 @@ class BasePlugin(Hoster): self.logWarning("Check result: " + errmsg, "Waiting 1 minute and retry") self.retry(3, 60, errmsg) - - -getInfo = create_getInfo(BasePlugin) diff --git a/pyload/plugin/internal/MultiHook.py b/pyload/plugin/internal/MultiHook.py index d43956691..ab96d30ca 100644 --- a/pyload/plugin/internal/MultiHook.py +++ b/pyload/plugin/internal/MultiHook.py @@ -54,8 +54,6 @@ class MultiHook(Hook): def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - self.plugins = [] self.supported = [] self.new_supported = [] @@ -82,7 +80,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(): @@ -94,7 +92,7 @@ class MultiHook(Hook): def activate(self): - self._loadAccount() + self.initPeriodical(threaded=True) def getURL(self, *args, **kwargs): #@TODO: Remove in 0.4.10 @@ -137,9 +135,9 @@ class MultiHook(Hook): return list() try: - configmode = self.getConfig("pluginmode", 'all') + configmode = self.getConfig('pluginmode', 'all') if configmode in ("listed", "unlisted"): - pluginlist = self.getConfig("pluginlist", '').replace('|', ',').replace(';', ',').split(',') + pluginlist = self.getConfig('pluginlist', '').replace('|', ',').replace(';', ',').split(',') configset = self._pluginSet(pluginlist) if configmode == "listed": @@ -183,24 +181,12 @@ class MultiHook(Hook): raise NotImplementedError - #: Threaded _periodical, remove in 0.4.10 and use built-in flag for that - def _periodical(self): - try: - if self.isActivated(): - self.periodical() - - except Exception, e: - self.core.log.error(_("Error executing hooks: %s") % str(e)) - if self.core.debug: - print_exc() - - self.cb = self.core.scheduler.addJob(self.interval, self._periodical) - - def periodical(self): """reload plugin list periodically""" - if self.getConfig("reload", True): - self.interval = max(self.getConfig("reloadinterval", 12) * 60 * 60, self.MIN_RELOAD_INTERVAL) + self.loadAccount() + + if self.getConfig('reload', True): + self.interval = max(self.getConfig('reloadinterval', 12) * 60 * 60, self.MIN_RELOAD_INTERVAL) else: self.core.scheduler.removeJob(self.cb) self.cb = None diff --git a/pyload/plugin/internal/MultiHoster.py b/pyload/plugin/internal/MultiHoster.py index 036570805..e9bb483da 100644 --- a/pyload/plugin/internal/MultiHoster.py +++ b/pyload/plugin/internal/MultiHoster.py @@ -85,7 +85,7 @@ class MultiHoster(SimpleHoster): self.logWarning(_("Premium download failed")) self.retryFree() - elif self.getConfig("revertfailed", True) \ + elif self.getConfig('revertfailed', True) \ and "new_module" in self.core.pluginManager.hosterPlugins[self.__name__]: hdict = self.core.pluginManager.hosterPlugins[self.__name__] |