summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPatrick Shan <patrick@freelancer.com>2013-12-30 22:43:13 +1100
committerPatrick Shan <patrick@freelancer.com>2013-12-30 22:43:13 +1100
commit02617f334ce01cf95ce3ac49c05ac5a886a9aecc (patch)
treee2e32749adc3147dbcce2452e0bff04a014a83e1 /examples
parentd85f4042bb13dc1bc954ce47e2288d9e673d176f (diff)
* make cpu status cached for 10s and leave the output index to 0
Diffstat (limited to 'examples')
-rw-r--r--examples/sysdata.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/sysdata.py b/examples/sysdata.py
index 235808f..14aefb3 100644
--- a/examples/sysdata.py
+++ b/examples/sysdata.py
@@ -111,7 +111,8 @@ class Py3status:
response['color'] = i3status_config['color_bad']
response['full_text'] = "CPU: %.2f%%" % (used_cpu_percent*100)
- response['cached_until'] = time()
+ #cache the status for 10 seconds
+ response['cached_until'] = time() + 10
return (0, response)
@@ -133,4 +134,4 @@ class Py3status:
(used_mem, total_mem, used_mem_percent)
response['cached_until'] = time()
- return (1, response)
+ return (0, response)