summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/DownloadScheduler.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/DownloadScheduler.py')
-rw-r--r--module/plugins/hooks/DownloadScheduler.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py
index 4996e212d..9c74ac1d4 100644
--- a/module/plugins/hooks/DownloadScheduler.py
+++ b/module/plugins/hooks/DownloadScheduler.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import localtime
+import time
from module.plugins.Hook import Hook
@@ -22,13 +21,12 @@ class DownloadScheduler(Hook):
("stickell", "l.stickell@yahoo.it")]
- #@TODO: Remove in 0.4.10
- def initPeriodical(self):
- pass
+ interval = 0 #@TODO: Remove in 0.4.10
def setup(self):
- self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded
+ self.info = {} #@TODO: Remove in 0.4.10
+ self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded
def coreReady(self):
@@ -37,7 +35,7 @@ class DownloadScheduler(Hook):
def updateSchedule(self, schedule=None):
if schedule is None:
- schedule = self.getConfig("timetable")
+ schedule = self.getConfig('timetable')
schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)",
schedule.lower().replace("full", "-1").replace("none", "0"))
@@ -45,7 +43,7 @@ class DownloadScheduler(Hook):
self.logError(_("Invalid schedule"))
return
- t0 = localtime()
+ t0 = time.localtime()
now = (t0.tm_hour, t0.tm_min, t0.tm_sec, "X")
schedule = sorted([(int(x[0]), int(x[1]), 0, int(x[2])) for x in schedule] + [now])
@@ -65,7 +63,7 @@ class DownloadScheduler(Hook):
def setDownloadSpeed(self, speed):
if speed == 0:
- abort = self.getConfig("abort")
+ abort = self.getConfig('abort')
self.logInfo(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not '))
self.core.api.pauseServer()
if abort: