summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/Addon.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2013-10-12 21:26:11 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2013-11-16 17:40:15 +0100
commit90ede8582e75d451f923c5d0e50f971659ee00cd (patch)
tree7139e587ba6f362d273e2ffae7a393abb35b1758 /pyload/plugins/Addon.py
parentRenamed setInterval reset opt to recount (diff)
downloadpyload-90ede8582e75d451f923c5d0e50f971659ee00cd.tar.xz
initPeriodical calls startPeriodical if periodcal was overwritten
Diffstat (limited to 'pyload/plugins/Addon.py')
-rw-r--r--pyload/plugins/Addon.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pyload/plugins/Addon.py b/pyload/plugins/Addon.py
index 69280ca7e..d0ddfbca4 100644
--- a/pyload/plugins/Addon.py
+++ b/pyload/plugins/Addon.py
@@ -104,9 +104,13 @@ class Addon(Base):
#delete for various reasons
self.event_map = None
- #self.startPeriodical()
+ self.initPeriodical()
self.init()
+ def initPeriodical(self):
+ if id(self.periodical) != id(getattr(Addon, periodical)):
+ self.startPeriodical()
+
def startPeriodical(self, interval=self.interval, wait=self.interval):
if not self.cb and self.setInterval(interval, False):
self.cb = self.core.scheduler.addJob(wait, self._periodical, threaded=False)
@@ -118,7 +122,8 @@ class Addon(Base):
if self.cb and self.core.scheduler.removeJob(self.cb):
self.cb = None
return True
- return False
+ else:
+ return False
def setInterval(self, interval, recount=False):
if interval > 0: