diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-02 11:23:08 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-02 11:23:08 +0100 |
commit | 84402b1194e99327c75c8762f4754802ca140e6a (patch) | |
tree | 2281e553b6ba2c3523cd23add01d2abf28a9036b /module/plugins | |
parent | megaupload decode file info, megaupload/depositfiles folders (diff) | |
download | pyload-84402b1194e99327c75c8762f4754802ca140e6a.tar.xz |
closed #441
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/PluginManager.py | 2 | ||||
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 09d5f58e7..f3f5f47bc 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -326,7 +326,7 @@ class PluginManager: """ reloads and reindexes plugins """ if not type_plugins: return False - self.log.debug("Reload plugins: %s" % type_plugins) + self.log.debug("Request reload of plugins: %s" % type_plugins) as_dict = {} for t,n in type_plugins: diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 8212ddb65..46ca5cc4b 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -24,6 +24,7 @@ from os import stat from os.path import join from time import time +from module.ConfigParser import IGNORE from module.network.RequestFactory import getURL from module.plugins.Hook import threaded, Expose, Hook @@ -116,12 +117,12 @@ class UpdateManager(Hook): for plugin in updates: path, version = plugin.split(":") - prefix, name = path.split("/") + prefix, filename = path.split("/") - if name.endswith(".pyc"): - tmp_name = name[:name.find("_")] + if filename.endswith(".pyc"): + name = filename[:filename.find("_")] else: - tmp_name = name.replace(".py", "") + name = filename.replace(".py", "") if prefix.endswith("s"): type = prefix[:-1] @@ -130,10 +131,13 @@ class UpdateManager(Hook): plugins = getattr(self.core.pluginManager, "%sPlugins" % type) - if tmp_name in plugins: - if float(plugins[tmp_name]["v"]) >= float(version): + if name in plugins: + if float(plugins[name]["v"]) >= float(version): continue + if name in IGNORE or (type, name) in IGNORE: + continue + self.log.info(_("New version of %(type)s|%(name)s : %(version).2f") % { "type": type, "name": name, @@ -143,7 +147,7 @@ class UpdateManager(Hook): try: content = getURL("http://get.pyload.org/plugins/get/" + path) except Exception, e: - self.logWarning(_("Error when updating %s") % name, str(e)) + self.logWarning(_("Error when updating %s") % filename, str(e)) continue m = vre.search(content) @@ -151,7 +155,7 @@ class UpdateManager(Hook): self.logWarning(_("Error when updating %s") % name, _("Version mismatch")) continue - f = open(join("userplugins", prefix, name), "wb") + f = open(join("userplugins", prefix, filename), "wb") f.write(content) f.close() self.updated = True |