summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-12-18 06:04:18 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-12-27 22:36:18 +0100
commita0abb1ffa5662f1a14be6ea33fbceba33357bbf5 (patch)
tree873123c6277643183ca03c54a80e3ab554b61854 /module/plugins
parentNew plugin: EventMapper (diff)
downloadpyload-a0abb1ffa5662f1a14be6ea33fbceba33357bbf5.tar.xz
Don't use PERIODICAL_INTERVAL
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/ClickNLoad.py6
-rw-r--r--module/plugins/hooks/DeleteFinished.py5
-rw-r--r--module/plugins/hooks/RestartFailed.py7
-rw-r--r--module/plugins/internal/Account.py6
4 files changed, 8 insertions, 16 deletions
diff --git a/module/plugins/hooks/ClickNLoad.py b/module/plugins/hooks/ClickNLoad.py
index 0e039a6dc..08b16d221 100644
--- a/module/plugins/hooks/ClickNLoad.py
+++ b/module/plugins/hooks/ClickNLoad.py
@@ -8,8 +8,8 @@ try:
except ImportError:
pass
-from module.plugins.internal.Addon import Addon
-from module.plugins.internal.misc import forward, lock, threaded
+from module.plugins.internal.Addon import Addon, threaded
+from module.plugins.internal.misc import forward, lock
#@TODO: IPv6 support
@@ -46,7 +46,7 @@ class ClickNLoad(Addon):
@lock
@threaded
- def forward(self, source, destination, queue=False)
+ def forward(self, source, destination, queue=False):
if queue:
old_ids = set(pack.id for pack in self.pyload.api.getCollector())
diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py
index fa68ef19c..2fb8de938 100644
--- a/module/plugins/hooks/DeleteFinished.py
+++ b/module/plugins/hooks/DeleteFinished.py
@@ -19,9 +19,6 @@ class DeleteFinished(Addon):
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- PERIODICAL_INTERVAL = 1 * 60 * 60 #: 1 hour
-
-
def periodical(self):
if not self.info['sleep']:
deloffline = self.config.get('deloffline')
@@ -39,8 +36,8 @@ class DeleteFinished(Addon):
def activate(self):
self.info['sleep'] = True
- self.set_interval(self.config.get('interval') * 60 * 60)
self.add_event('package_finished', self.wakeup)
+ self.start_periodical(self.config.get('interval') * 60 * 60)
## own methods ##
diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py
index 33573a317..2babff89d 100644
--- a/module/plugins/hooks/RestartFailed.py
+++ b/module/plugins/hooks/RestartFailed.py
@@ -15,10 +15,7 @@ class RestartFailed(Addon):
__description__ = """Restart all the failed downloads in queue"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
-
-
- PERIODICAL_INTERVAL = 15 * 60 #: 15 minutes
-
+
def periodical(self):
self.log_info(_("Restarting all failed downloads..."))
@@ -26,4 +23,4 @@ class RestartFailed(Addon):
def activate(self):
- self.set_interval(self.config.get('interval') * 60)
+ self.start_periodical(self.config.get('interval') * 60)
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py
index 7c614f579..f2ab73653 100644
--- a/module/plugins/internal/Account.py
+++ b/module/plugins/internal/Account.py
@@ -23,9 +23,7 @@ class Account(Plugin):
LOGIN_TIMEOUT = 30 * 60 #: Relogin account every 30 minutes
TUNE_TIMEOUT = True #: Automatically tune relogin interval
- PERIODICAL_INTERVAL = None
-
-
+
def __init__(self, manager, accounts):
self._init(manager.core)
@@ -74,7 +72,7 @@ class Account(Plugin):
def set_interval(self, value):
- newinterval = max(0, self.PERIODICAL_INTERVAL, value)
+ newinterval = max(0, value)
if newinterval != value:
return False