diff options
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 6a45cdace..a49a007f1 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -22,6 +22,7 @@ from module.plugins.Hook import Hook import subprocess from os import listdir, sep from os.path import join +import sys class ExternalScripts(Hook): __name__ = "ExternalScripts" @@ -81,8 +82,13 @@ class ExternalScripts(Hook): def packageFinished(self, pypack): for script in self.scripts['package_finished']: + folder = self.core.config['general']['download_folder'] + if pypack.data["package_name"] != (self.core.config['general']['link_file']) and self.core.xmlconfig.get("general", "folder_per_package", False): + folder = join(folder.decode(sys.getfilesystemencoding()), pypack.data["package_name"].decode(sys.getfilesystemencoding())) + + print folder try: - out = subprocess.Popen([join(self.folder, 'package_finished', script), pypack.data['package_name'], pypack.data['folder']], stdout=subprocess.PIPE) + out = subprocess.Popen([join(self.folder, 'package_finished', script), pypack.data['package_name'], folder], stdout=subprocess.PIPE) except: pass |