summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-06-20 14:36:15 +0200
committerGravatar Jeix <devnull@localhost> 2010-06-20 14:36:15 +0200
commit1a4e9a7ceaa82558b0dea0ee05139deb14942c77 (patch)
tree5555c4d28a025fe9a0cbbd9922de6e82ac569414 /module/plugins/hooks
parentPackage_finished event for scripts implemented (diff)
downloadpyload-1a4e9a7ceaa82558b0dea0ee05139deb14942c77.tar.xz
workaround for ExternalScripts.py package location
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/ExternalScripts.py8
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