diff options
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/Checksum.py | 10 | ||||
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 9 | ||||
-rw-r--r-- | module/plugins/hooks/HotFolder.py | 3 | ||||
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 4 |
4 files changed, 15 insertions, 11 deletions
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 6ecbfcda2..da4d35df1 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -131,15 +131,15 @@ class Checksum(Addon): for key in self.algorithms: if key in data: - checksum = computeChecksum(local_file, key.replace("-", "").lower()) + checksum = compute_checksum(local_file, key.replace("-", "").lower()) if checksum: - if checksum is data[key].lower(): + if checksum == data[key].lower(): self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break else: self.log_warning(_("%s checksum for file %s does not match (%s != %s)") % - (key.upper(), pyfile.name, checksum, data[key])) + (key.upper(), pyfile.name, checksum, data[key].lower())) self.check_failed(pyfile, local_file, "Checksums do not match") else: self.log_warning(_("Unsupported hashing algorithm"), key.upper()) @@ -186,7 +186,7 @@ class Checksum(Addon): local_file = fs_encode(fs_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) - checksum = computeChecksum(local_file, algorithm) + checksum = compute_checksum(local_file, algorithm) if checksum is data['HASH']: self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (data['NAME'], algorithm, checksum)) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index b7495136a..4ec526d35 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,6 +3,7 @@ import os import subprocess +from module.plugins.internal.Plugin import encode from module.plugins.internal.Addon import Addon, Expose from module.utils import fs_encode, save_join as fs_join @@ -10,7 +11,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.46" + __version__ = "0.47" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -66,7 +67,8 @@ class ExternalScripts(Addon): self.log_debug(e) return - for file in os.listdir(path): + for filename in os.listdir(path): + file = fs_join(path, filename) if not os.path.isfile(file): continue @@ -77,13 +79,14 @@ class ExternalScripts(Addon): self.log_warning(_("Script not executable: [%s] %s") % (name, file)) self.scripts[name].append(file) + self.log_info(_("Registered script: [%s] %s") % (name, file)) @Expose def call(self, script, args=[], lock=False): try: script = os.path.abspath(script) - args = [script] + map(encode, args) + args = [script] + map(lambda arg: encode(arg) if isinstance(arg, basestring) else encode(str(arg)), args) self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args)) p = subprocess.Popen(args, bufsize=-1) #@NOTE: output goes to pyload diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 84db4db17..5a65146b9 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -14,7 +14,7 @@ from module.utils import fs_encode, save_join as fs_join class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __status__ = "testing" __config__ = [("folder" , "str" , "Folder to observe" , "container"), @@ -29,6 +29,7 @@ class HotFolder(Addon): def init(self): self.interval = 30 + self.init_periodical() def periodical(self): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 117da0633..fb9e28b5d 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -17,7 +17,7 @@ from module.utils import fs_encode, save_join as fs_join class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.55" + __version__ = "0.56" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -268,7 +268,7 @@ class UpdateManager(Addon): raise Exception(_("Version mismatch")) except Exception, e: - self.log_error(_("Error updating plugin: %s") % filename, e) + self.log_error(_("Error updating plugin: [%s] %s") % (type, name), e) if self.pyload.debug: traceback.print_exc() |