diff options
author | mkaay <mkaay@mkaay.de> | 2010-01-04 20:35:26 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-01-04 20:35:26 +0100 |
commit | 89acc0ff595f73956572c8892ccb860c06fba33a (patch) | |
tree | 6edad5f8e0ca153b186a182b63aa5a5de815fe05 /pyLoadCore.py | |
parent | fixed webserver (diff) | |
download | pyload-89acc0ff595f73956572c8892ccb860c06fba33a.tar.xz |
added hook system
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index e586ee080..a5521cd70 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -57,7 +57,8 @@ from module.XMLConfigParser import XMLConfigParser from module.file_list import File_List
from module.thread_list import Thread_List
from module.web.ServerThread import WebServer
-from module.CaptchaManager import CaptchaManager
+from module.CaptchaManager import CaptchaManager +from module.HookManager import HookManager
from xmlrpclib import Binary
@@ -106,10 +107,6 @@ 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/reconnected/'] # @TODO: windows save?
-
- 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)
@@ -122,7 +119,7 @@ class Core(object): else:
self.init_logger(logging.INFO) # logging level
- self.init_scripts()
+ self.init_hooks()
path.append(self.plugin_folder)
self.create_plugin_index()
@@ -216,19 +213,8 @@ class Core(object): self.logger.addHandler(console) #if console logging
self.logger.setLevel(level)
- def init_scripts(self):
- """ scan directory for scripts to execute"""
- f = lambda x: False if x.startswith("#") or x.endswith("~") else True
- self.scripts = {}
- #@TODO: windows save?!
- self.scripts['download_preparing'] = map(lambda x: 'scripts/download_preparing/' + x, filter(f, listdir('scripts/download_preparing')))
- self.scripts['download_finished'] = map(lambda x: 'scripts/download_finished/' + x, filter(f, listdir('scripts/download_finished')))
- self.scripts['package_finished'] = map(lambda x: 'scripts/package_finished/' + x, filter(f, listdir('scripts/package_finished')))
- self.scripts['reconnected'] = map(lambda x: 'scripts/reconnected/' + x, filter(f, listdir('scripts/reconnected')))
-
- for script_type, script_name in self.scripts.iteritems():
- if script_name != []:
- self.logger.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name)))
+ def init_hooks(self):
+ self.hookManager = HookManager(self)
def check_install(self, check_name, legend, python=True, essential=False):
"""check wether needed tools are installed"""
|