summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/MultiHook.py18
-rw-r--r--module/plugins/internal/SimpleDereferer.py2
-rw-r--r--module/plugins/internal/SimpleHoster.py10
3 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/internal/MultiHook.py b/module/plugins/internal/MultiHook.py
index 291063268..51c8ea89f 100644
--- a/module/plugins/internal/MultiHook.py
+++ b/module/plugins/internal/MultiHook.py
@@ -2,6 +2,7 @@
import re
import time
+import traceback
from module.plugins.Hook import Hook
from module.utils import decode, remove_chars
@@ -10,7 +11,7 @@ from module.utils import decode, remove_chars
class MultiHook(Hook):
__name__ = "MultiHook"
__type__ = "hook"
- __version__ = "0.41"
+ __version__ = "0.44"
__config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
("pluginlist" , "str" , "Plugin list (comma separated)", "" ),
@@ -70,16 +71,15 @@ class MultiHook(Hook):
def initPlugin(self):
- plugin, type = self.core.pluginManager.findPlugin(self.__name__)
+ self.pluginname = self.__name__.rsplit("Hook", 1)[0]
+ plugin, self.plugintype = self.core.pluginManager.findPlugin(self.pluginname)
- if not plugin:
+ if plugin:
+ self.pluginmodule = self.core.pluginManager.loadModule(self.plugintype, self.pluginname)
+ self.pluginclass = getattr(self.pluginmodule, self.pluginname)
+ else:
self.logWarning("Hook plugin will be deactivated due missing plugin reference")
self.setConfig('activated', False)
- else:
- self.pluginname = self.__name__
- self.plugintype = type
- self.pluginmodule = self.core.pluginManager.loadModule(type, self.__name__)
- self.pluginclass = getattr(self.pluginmodule, self.__name__)
def loadAccount(self):
@@ -188,7 +188,7 @@ class MultiHook(Hook):
except Exception, e:
self.core.log.error(_("Error executing hooks: %s") % str(e))
if self.core.debug:
- print_exc()
+ traceback.print_exc()
self.cb = self.core.scheduler.addJob(self.interval, self._periodical)
diff --git a/module/plugins/internal/SimpleDereferer.py b/module/plugins/internal/SimpleDereferer.py
index 360cd7c30..743a98721 100644
--- a/module/plugins/internal/SimpleDereferer.py
+++ b/module/plugins/internal/SimpleDereferer.py
@@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import getFileURL, set_cookies
class SimpleDereferer(Crypter):
__name__ = "SimpleDereferer"
__type__ = "crypter"
- __version__ = "0.08"
+ __version__ = "0.11"
__pattern__ = r'^unmatchable$'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 6f1c7409d..8b1527b3e 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -30,7 +30,7 @@ def _error(self, reason, type):
type = "unknown"
msg = _("%s error") % type.strip().capitalize() if type else _("Error")
- msg += ": %s" % reason.strip() if reason else ""
+ msg += (": %s" % reason.strip()) if reason else ""
msg += _(" | Plugin may be out of date")
raise Fail(msg)
@@ -238,7 +238,7 @@ def secondsToMidnight(gmt=0):
if hasattr(td, 'total_seconds'):
res = td.total_seconds()
- else: #: work-around for python 2.5 and 2.6 missing datetime.timedelta.total_seconds
+ else: #@NOTE: work-around for python 2.5 and 2.6 missing datetime.timedelta.total_seconds
res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
return int(res)
@@ -247,7 +247,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.33"
+ __version__ = "1.35"
__pattern__ = r'^unmatchable$'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -315,7 +315,7 @@ class SimpleHoster(Hoster):
@classmethod
- def parseInfos(cls, urls): #@TODO: Built-in in 0.4.10 core, then remove from plugins
+ def parseInfos(cls, urls): #@TODO: Built-in in 0.4.10 core (remove from plugins)
for url in urls:
url = replace_patterns(url, cls.URL_REPLACEMENTS)
yield cls.getInfo(url)
@@ -498,7 +498,7 @@ class SimpleHoster(Hoster):
raise Fail(e)
- #: Work-around to `filename*=UTF-8` bug; remove in 0.4.10
+ #@NOTE: Work-around to `filename*=UTF-8` bug; remove in 0.4.10
def download(self, url, get={}, post={}, ref=True, cookies=True, disposition=False):
try:
if disposition: