diff options
author | Walter Purcaro <vuolter@gmail.com> | 2013-09-17 22:24:41 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2013-11-16 17:40:14 +0100 |
commit | a38b282781c1453cc89682ab8c1cff0ecf6704ce (patch) | |
tree | 8b65ddef7c1c81bf3e57be11000e085b5d370c42 /pyload | |
parent | typo (diff) | |
download | pyload-a38b282781c1453cc89682ab8c1cff0ecf6704ce.tar.xz |
Improved start and stop methods
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/plugins/Addon.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pyload/plugins/Addon.py b/pyload/plugins/Addon.py index 60243a8bd..be317eb0d 100644 --- a/pyload/plugins/Addon.py +++ b/pyload/plugins/Addon.py @@ -107,20 +107,18 @@ class Addon(Base): #self.startPeriodical() self.init() - def startPeriodical(self, interval=self.interval, wait=0): - if not self.cb and self.setInterval(interval): + 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) return interval else: return False def stopPeriodical(self): - if not self.cb: - return False - r = self.core.scheduler.removeJob(self.cb) - if r: + if self.cb and self.core.scheduler.removeJob(self.cb): self.cb = None - return r #: return True if successfully removed else False + return True + return False def setInterval(self, interval, reset=False): if interval > 0: |