diff options
author | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-10-13 22:04:45 +0200 |
---|---|---|
committer | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-10-13 22:04:45 +0200 |
commit | b05706efd5205ec0a492eafe193b5bf4498e3316 (patch) | |
tree | f33c49a95568a95b19f44de133b4f3554108d3bb /module/plugins | |
parent | Merge pull request #2023 from astranCZ/patch-2 (diff) | |
download | pyload-b05706efd5205ec0a492eafe193b5bf4498e3316.tar.xz |
[UpdateManager] report 404
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index caebdaa9b..876849953 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -16,7 +16,7 @@ from module.utils import fs_encode, save_join as fs_join class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "1.00" + __version__ = "1.01" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -278,6 +278,7 @@ class UpdateManager(Addon): 'name': n, }) + req = self.pyload.requestFactory.getRequest(self.classname) for plugin in updatelist: name = plugin['name'] type = plugin['type'] @@ -300,9 +301,12 @@ class UpdateManager(Addon): 'oldver': oldver, 'newver': newver}) try: - content = self.load(url % plugin + ".py", decode=False) - m = self._VERSION.search(content) + content = self.load(url % plugin + ".py", decode=False, req=req) + if req.code == 404: + raise Exception(_("Plugin URL not found (404)")) + + m = self._VERSION.search(content) if m and m.group(2) == version: #@TODO: Remove in 0.4.10 if type in ("account", "hook"): @@ -315,7 +319,7 @@ class UpdateManager(Addon): updated.append((type, name)) else: - raise Exception(_("Version mismatch")) + raise Exception(_("Plugin version mismatch")) except Exception, e: self.log_error(_("Error updating plugin: %s %s") % (type.upper(), name), e) @@ -372,7 +376,7 @@ class UpdateManager(Addon): os.remove(filename) except OSError, e: - self.log_warning(_("Error removing: %s") % filename, e) + self.log_error(_("Error removing: %s") % filename, e) else: id = (type, name) |