diff options
author | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-08-06 00:32:24 +0200 |
---|---|---|
committer | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-08-06 00:32:24 +0200 |
commit | d0edd32552a41ad95bfd13dffde2f9017daedc57 (patch) | |
tree | 560987c8971037c74840e3a1d5c50d366ba0632f /module/plugins | |
parent | Fix https://github.com/pyload/pyload/issues/1707 (diff) | |
download | pyload-d0edd32552a41ad95bfd13dffde2f9017daedc57.tar.xz |
fix ExternalScripts not working
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index b7495136a..d5720f68d 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 @@ -83,7 +85,7 @@ class ExternalScripts(Addon): 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 |