summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/LogMarker.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-08 06:31:07 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-08 06:31:07 +0200
commit6e8f0f58ed3ec51b1d15ff0ae21411e5d8dc986e (patch)
tree801649c39dbc16fbee4cd2b0a6d96edad27e4212 /module/plugins/hooks/LogMarker.py
parentFixpack (4) (diff)
downloadpyload-6e8f0f58ed3ec51b1d15ff0ae21411e5d8dc986e.tar.xz
New plugin: LogMarker
Diffstat (limited to 'module/plugins/hooks/LogMarker.py')
-rw-r--r--module/plugins/hooks/LogMarker.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/module/plugins/hooks/LogMarker.py b/module/plugins/hooks/LogMarker.py
index eb78a28ff..e59e94598 100644
--- a/module/plugins/hooks/LogMarker.py
+++ b/module/plugins/hooks/LogMarker.py
@@ -1,20 +1,37 @@
# -*- coding: utf-8 -*-
+import datetime
+
from module.plugins.internal.Addon import Addon, Expose
+from module.plugins.internal.Plugin import seconds_to_nexthour
class LogMarker(Addon):
__name__ = "LogMarker"
__type__ = "hook"
- __version__ = "0.01"
+ __version__ = "0.02"
__status__ = "testing"
- __description__ = """Log a mark when the day begins"""
+ __config__ = [("activated", "bool", "Activated" , False),
+ ("mark_hour", "bool", "Mark hours", True ),
+ ("mark_day" , "bool", "Mark days" , True )]
+
+ __description__ = """Print a mark in the log"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+ def init(self):
+ self.start_periodical(1 * 60 * 60 - 1, delay=seconds_to_nexthour(strict=True) - 1)
+
+
def periodical(self):
- self.log_info("------------------------------------------------")
- self.log_info(_("--------------------- MARK ---------------------"))
- self.log_info("------------------------------------------------") \ No newline at end of file
+ if self.get_config('mark_day') and datetime.datetime.today().hour is 0:
+ self.log_info("------------------------------------------------")
+ self.log_info(_("------------------- DAY MARK -------------------"))
+ self.log_info("------------------------------------------------")
+
+ elif self.get_config('mark_hour'):
+ self.log_info("------------------------------------------------")
+ self.log_info(_("------------------- HOUR MARK ------------------"))
+ self.log_info("------------------------------------------------")