diff options
author | Jeix <devnull@localhost> | 2010-06-20 14:36:15 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-06-20 14:36:15 +0200 |
commit | 1a4e9a7ceaa82558b0dea0ee05139deb14942c77 (patch) | |
tree | 5555c4d28a025fe9a0cbbd9922de6e82ac569414 /module/plugins/hooks/ExternalScripts.py | |
parent | Package_finished event for scripts implemented (diff) | |
download | pyload-1a4e9a7ceaa82558b0dea0ee05139deb14942c77.tar.xz |
workaround for ExternalScripts.py package location
Diffstat (limited to 'module/plugins/hooks/ExternalScripts.py')
-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 |