summaryrefslogtreecommitdiffstats
path: root/module/plugins/Hook.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/Hook.py')
-rw-r--r--module/plugins/Hook.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index 1e4749cd5..4d43b70f7 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -81,10 +81,12 @@ class Hook(Base):
self.initPeriodical()
self.setup()
+
def initPeriodical(self):
if self.interval >=1:
self.cb = self.core.scheduler.addJob(0, self._periodical, threaded=False)
+
def _periodical(self):
try:
if self.isActivated(): self.periodical()
@@ -99,14 +101,17 @@ class Hook(Base):
def __repr__(self):
return "<Hook %s>" % self.__name__
+
def setup(self):
""" more init stuff if needed """
pass
+
def unload(self):
""" called when hook was deactivated """
pass
+
def isActivated(self):
""" checks if hook is activated"""
return self.config.getPlugin(self.__name__, "activated")
@@ -116,36 +121,47 @@ class Hook(Base):
def coreReady(self):
pass
+
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
+
def newCaptchaTask(self, task):
""" new captcha task for the plugin, it MUST set the handler and timeout or will be ignored """
pass
+
def captchaCorrect(self, task):
pass
+
def captchaInvalid(self, task):
pass