diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-02 00:08:42 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-02 00:08:42 +0100 |
commit | 2a8d0af88b07e62eeb316a8dfbb7cd8d7dbfdcac (patch) | |
tree | 4324ec7c224724156ee9897e8689135f85e2e804 /module/plugins/hooks | |
parent | Merge pull request #920 from chris-19/stable (diff) | |
parent | [SimpleHoster] Force _isDirectLink to old style (diff) | |
download | pyload-2a8d0af88b07e62eeb316a8dfbb7cd8d7dbfdcac.tar.xz |
Merge branch 'stable-next' into stable
Diffstat (limited to 'module/plugins/hooks')
-rwxr-xr-x | module/plugins/hooks/Captcha9kw.py | 2 | ||||
-rw-r--r-- | module/plugins/hooks/Checksum.py | 9 | ||||
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 15 |
3 files changed, 16 insertions, 10 deletions
diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index 38b39b2af..ead8aec9a 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -56,7 +56,7 @@ class Captcha9kw(Hook): if res.isdigit(): self.logInfo(_("%s credits left") % res) - credits = self.info["credits"] = int(res) + credits = self.info['credits'] = int(res) return credits else: self.logError(res) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index b746fce5f..eeda2d849 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -81,10 +81,15 @@ class Checksum(Hook): a) if known, the exact filesize in bytes (e.g. "size": 123456789) b) hexadecimal hash string with algorithm name as key (e.g. "md5": "d76505d0869f9f928a17d42d66326307") """ - if hasattr(pyfile.plugin, "check_data") and (isinstance(pyfile.plugin.check_data, dict)): + if hasattr(pyfile.plugin, "check_data") and isinstance(pyfile.plugin.check_data, dict): data = pyfile.plugin.check_data.copy() - elif hasattr(pyfile.plugin, "api_data") and (isinstance(pyfile.plugin.api_data, dict)): + + elif hasattr(pyfile.plugin, "api_data") and isinstance(pyfile.plugin.api_data, dict): data = pyfile.plugin.api_data.copy() + + # elif hasattr(pyfile.plugin, "info") and isinstance(pyfile.plugin.info, dict): + # data = pyfile.plugin.info.copy() + else: return diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 3fda0b5e8..9c26cf5d9 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -14,13 +14,14 @@ from module.utils import save_join class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.39" + __version__ = "0.40" - __config__ = [("activated", "bool", "Activated", True), - ("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"), - ("interval", "int", "Check interval in hours", 8), - ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), - ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] + __config__ = [("activated" , "bool" , "Activated" , True ), + ("mode" , "pyLoad + plugins;plugins only", "Check updates for" , "pyLoad + plugins"), + ("interval" , "int" , "Check interval in hours" , 8 ), + ("autorestart" , "bool" , "Automatically restart pyLoad when required" , True ), + ("reloadplugins", "bool" , "Monitor plugins for code changes in debug mode", True ), + ("nodebugupdate", "bool" , "Don't check for updates in debug mode" , True )] __description__ = """ Check for updates """ __license__ = "GPLv3" @@ -123,7 +124,7 @@ class UpdateManager(Hook): status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") - if status == 2: + if status is 2 and self.getConfig("autorestart"): self.core.api.restart() else: self.updating = False |