diff options
Diffstat (limited to 'module/plugins/Hook.py')
-rw-r--r-- | module/plugins/Hook.py | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index b9c7b832f..5efd08bae 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - + @author: mkaay @interface-version: 0.2 """ @@ -22,7 +22,6 @@ from traceback import print_exc from Plugin import Base - class Expose(object): """ used for decoration to declare rpc services """ @@ -30,14 +29,11 @@ class Expose(object): hookManager.addRPC(f.__module__, f.func_name, f.func_doc) return f - def threaded(f): - def run(*args,**kwargs): hookManager.startThread(f, *args, **kwargs) return run - class Hook(Base): """ Base class for hook plugins. @@ -46,8 +42,8 @@ class Hook(Base): __version__ = "0.2" __type__ = "hook" __threaded__ = [] - __config__ = [("name", "type", "desc", "default")] - __description__ = """Interface for hook""" + __config__ = [ ("name", "type", "desc" , "default") ] + __description__ = """interface for hook""" __author_name__ = ("mkaay", "RaNaN") __author_mail__ = ("mkaay@mkaay.de", "RaNaN@pyload.org") @@ -112,7 +108,7 @@ class Hook(Base): def __repr__(self): return "<Hook %s>" % self.__name__ - + def setup(self): """ more init stuff if needed """ pass @@ -120,11 +116,11 @@ class Hook(Base): def unload(self): """ called when hook was deactivated """ pass - + def isActivated(self): """ checks if hook is activated""" return self.config.getPlugin(self.__name__, "activated") - + #event methods - overwrite these if needed def coreReady(self): @@ -132,25 +128,25 @@ class Hook(Base): def coreExiting(self): pass - + def downloadPreparing(self, pyfile): pass - + def downloadFinished(self, pyfile): pass - + def downloadFailed(self, pyfile): pass - + def packageFinished(self, pypack): pass def beforeReconnecting(self, ip): pass - + def afterReconnecting(self, ip): pass - + def periodical(self): pass @@ -162,4 +158,4 @@ class Hook(Base): pass def captchaInvalid(self, task): - pass + pass
\ No newline at end of file |