summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-19 09:15:48 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-19 09:15:48 +0100
commita3ee10a2afbbbf50f610290787cdb1a9ec89c437 (patch)
treea20bf818cffa0fd6ed3dbbe3694f35c4848681e8 /examples
parentdo not do unneccasary work (diff)
downloadblueshift-a3ee10a2afbbbf50f610290787cdb1a9ec89c437.tar.gz
blueshift-a3ee10a2afbbbf50f610290787cdb1a9ec89c437.tar.bz2
blueshift-a3ee10a2afbbbf50f610290787cdb1a9ec89c437.tar.xz
update every 5:th second instead of every minute
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/comprehensive7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/comprehensive b/examples/comprehensive
index 26abc3c..f033d27 100644
--- a/examples/comprehensive
+++ b/examples/comprehensive
@@ -155,8 +155,10 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
(*) Can be exceeded if the calendar system is changed, like in 1712-(02)Feb-30
(**) See https://en.wikipedia.org/wiki/Leap_second
'''
- global last_dayness
+ global last_dayness, wait_period
+
dayness = get_dayness()
+ # Do not do unnecessary work
if fade is None:
if dayness == last_dayness:
return
@@ -223,6 +225,9 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
randr()
else:
randr(m)
+
+ # Lets wait only 5 seconds, instead of a minute before running again
+ wait_period = 10
def reset():