diff options
author | Vuolter <vuolter@gmail.com> | 2013-05-11 19:28:38 +0200 |
---|---|---|
committer | Vuolter <vuolter@gmail.com> | 2013-05-11 19:28:38 +0200 |
commit | a133bdfe5e673479f3441afa7ae2f7c337753852 (patch) | |
tree | 0de49ee5221520c9f83bd763ff990e574a27a5a2 /module/plugins | |
parent | Added plugin DeleteFinished, version 0.1 (diff) | |
download | pyload-a133bdfe5e673479f3441afa7ae2f7c337753852.tar.xz |
Version 0.2: fixes
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/DeleteFinished.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 6098db9a5..be83d6ced 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -23,19 +23,18 @@ from time import time class DeleteFinished(Hook): __name__ = "DeleteFinished" - __version__ = "0.1" + __version__ = "0.2" __description__ = "Automatically delete finished packages from queue" __config__ = [ ("activated", "bool", "Activated", "False"), - ("interval", "int", "Delete every (hours)", "48") + ("interval", "int", "Delete every (hours)", "72") ] __author_name__ = ("Walter Purcaro") __author_mail__ = ("vuolter@gmail.com") - event_map = {"periodical": "check"} - - def check(self): - now = time.time() + #: event_map don't load periodical anyway + def periodical(self): + now = time() deletetime = self.getConfig("interval") * 3600 + self.info["lastdelete"] if now >= deletetime: self.core.api.deleteFinished() @@ -43,6 +42,6 @@ class DeleteFinished(Hook): self.info["lastdelete"] = now def setup(self): - now = time.time() + now = time() self.info = {"lastdelete": now} self.interval = 3600 |