summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/addon/DownloadScheduler.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/addon/DownloadScheduler.py')
-rw-r--r--pyload/plugins/addon/DownloadScheduler.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/pyload/plugins/addon/DownloadScheduler.py b/pyload/plugins/addon/DownloadScheduler.py
index 48bbeb3af..ef15a859f 100644
--- a/pyload/plugins/addon/DownloadScheduler.py
+++ b/pyload/plugins/addon/DownloadScheduler.py
@@ -8,26 +8,28 @@ from pyload.plugins.base.Addon import Addon
class DownloadScheduler(Addon):
- __name__ = "DownloadScheduler"
- __type__ = "addon"
+ __name__ = "DownloadScheduler"
+ __type__ = "addon"
__version__ = "0.21"
- __config__ = [("activated", "bool", "Activated", False),
- ("timetable", "str", "List time periods as hh:mm full or number(kB/s)",
+ __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)",
"0:00 full, 7:00 250, 10:00 0, 17:00 150"),
("abort", "bool", "Abort active downloads when start period with speed 0", False)]
__description__ = """Download Scheduler"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
- ("stickell", "l.stickell@yahoo.it")]
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
+ ("stickell", "l.stickell@yahoo.it")]
def setup(self):
- self.cb = None # callback to scheduler job; will be by removed AddonManager when addon unloaded
+ self.cb = None #: callback to scheduler job; will be by removed AddonManager when addon unloaded
+
def coreReady(self):
self.updateSchedule()
+
def updateSchedule(self, schedule=None):
if schedule is None:
schedule = self.getConfig("timetable")
@@ -55,6 +57,7 @@ class DownloadScheduler(Addon):
self.core.scheduler.removeJob(self.cb)
self.cb = self.core.scheduler.addJob(next_time, self.updateSchedule, threaded=False)
+
def setDownloadSpeed(self, speed):
if speed == 0:
abort = self.getConfig("abort")