From 81508f295cffc40c479fe72f24bdf1dbbedf5d92 Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 5 May 2010 23:03:43 +0200 Subject: refactored plugins, new plugin manager --- module/plugins/hooks/ClickAndLoad.py | 14 +++++--------- module/plugins/hooks/ContainerDownload.py | 14 +++++--------- module/plugins/hooks/ExternalScripts.py | 14 ++++++-------- module/plugins/hooks/LinuxFileEvents.py | 11 ++++++----- 4 files changed, 22 insertions(+), 31 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 52088bf29..adb26eab0 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -25,15 +25,11 @@ import thread from module.plugins.Hook import Hook class ClickAndLoad(Hook): - def __init__(self, core): - Hook.__init__(self, core) - props = {} - props['name'] = "ClickAndLoad" - props['version'] = "0.2" - props['description'] = """Gives abillity to use jd's click and load. depends on webinterface""" - props['author_name'] = ("RaNaN", "mkaay") - props['author_mail'] = ("RaNaN@pyload.de", "mkaay@mkaay.de") - self.props = props + __name__ = "ClickAndLoad" + __version__ = "0.2" + __description__ = """Gives abillity to use jd's click and load. depends on webinterface""" + __author_name__ = ("RaNaN", "mkaay") + __author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de") def coreReady(self): self.port = int(self.core.config['webinterface']['port']) diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py index f520b705c..673931391 100644 --- a/module/plugins/hooks/ContainerDownload.py +++ b/module/plugins/hooks/ContainerDownload.py @@ -23,15 +23,11 @@ from module.plugins.Hook import Hook from os.path import join, abspath class ContainerDownload(Hook): - def __init__(self, core): - Hook.__init__(self, core) - props = {} - props['name'] = "ContainerDownload" - props['version'] = "0.1" - props['description'] = """add the downloaded container to current package""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - self.props = props + __name__ = "ContainerDownload" + __version__ = "0.1" + __description__ = """add the downloaded container to current package""" + __author_name__ = ("mkaay") + __author_mail__ = ("mkaay@mkaay.de") def downloadFinished(self, pyfile): filename = pyfile.status.filename diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 50f6149a2..9e0f3855c 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -24,16 +24,14 @@ from os import listdir, sep from os.path import join class ExternalScripts(Hook): + __name__ = "ExternalScripts" + __version__ = "0.1" + __description__ = """run external scripts""" + __author_name__ = ("mkaay", "RaNaN", "spoob") + __author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") + def __init__(self, core): Hook.__init__(self, core) - props = {} - props['name'] = "ExternalScripts" - props['version'] = "0.1" - props['description'] = """run external scripts""" - props['author_name'] = ("mkaay", "RaNaN", "spoob") - props['author_mail'] = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") - self.props = props - self.core = core self.scripts = {} script_folders = [join(core.path, 'scripts','download_preparing'), diff --git a/module/plugins/hooks/LinuxFileEvents.py b/module/plugins/hooks/LinuxFileEvents.py index da1b06f13..44f3f00e8 100644 --- a/module/plugins/hooks/LinuxFileEvents.py +++ b/module/plugins/hooks/LinuxFileEvents.py @@ -22,14 +22,15 @@ from module.plugins.Hook import Hook import os class LinuxFileEvents(Hook): + __name__ = "LinuxFileEvents" + __version__ = "0.1" + __description__ = """monitors files and directories for changes""" + __author_name__ = ("mkaay") + __author_mail__ = ("mkaay@mkaay.de") + def __init__(self, core): Hook.__init__(self, core) props = {} - props['name'] = "LinuxFileEvents" - props['version'] = "0.1" - props['description'] = """monitors files and directories for changes""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") self.props = props return #@TODO remove when working correctly -- cgit v1.2.3