diff options
author | spoob <spoob@gmx.de> | 2010-01-26 22:10:09 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-01-26 22:10:09 +0100 |
commit | 7223256dbcbcad79b5edf0f71f525264903607f9 (patch) | |
tree | 12b35b26d77e55fd3c5102edd92b536d1e55f73c | |
parent | extended script support (diff) | |
download | pyload-7223256dbcbcad79b5edf0f71f525264903607f9.tar.xz |
Better Script Support
-rw-r--r-- | module/HookManager.py | 16 | ||||
-rwxr-xr-x | pyLoadCore.py | 4 |
2 files changed, 14 insertions, 6 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index 5dbf41936..66a65acc8 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -43,17 +43,21 @@ class HookManager(): self.lock.acquire() f = lambda x: False if x.startswith("#") or x.endswith("~") else True - self.scripts = {} + self.scripts = {} folder = join(self.core.path, "scripts") - self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) - self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) - self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) - self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) + self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) + self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) + self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) + self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) - self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) + for script_type, script_name in self.scripts.iteritems(): + if script_name != []: + self.logger.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name))) + + #~ self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) self.folder = folder diff --git a/pyLoadCore.py b/pyLoadCore.py index 7aa38b9b1..203639c63 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -119,6 +119,10 @@ class Core(object): self.check_file(self.config['general']['link_file'], _("file for links"))
self.check_file(self.config['general']['failed_file'], _("file for failed links"))
+
+ script_folders = ['scripts/download_preparing/', 'scripts/download_finished/', 'scripts/package_finished/', 'scripts/before_reconnect/', 'scripts/after_reconnect/'] # @TODO: yes, replace / with sep
+ self.check_file(script_folders, _("folders for scripts"), True)
+
if self.config['ssl']['activated']:
self.check_install("OpenSSL", "OpenSSL for secure connection", True)
self.check_file(self.config['ssl']['cert'], _("ssl certificate"), False, True)
|