summaryrefslogtreecommitdiffstats
path: root/py3status
diff options
context:
space:
mode:
authorUltrabug <ultrabug@gentoo.org>2015-08-03 15:49:43 +0200
committerUltrabug <ultrabug@gentoo.org>2015-08-03 15:49:43 +0200
commitc3401648d6b300a2455f9d3a4ee846234d27c150 (patch)
tree6d5fb36988ebd8399183bc285fea8a92df577142 /py3status
parent997ffaa72e4bfa6e598723908c88952988ca69be (diff)
taskwarrior module: QA and python3 support
Diffstat (limited to 'py3status')
-rw-r--r--py3status/modules/taskwarrior.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/py3status/modules/taskwarrior.py b/py3status/modules/taskwarrior.py
index 75faa8f..65407e5 100644
--- a/py3status/modules/taskwarrior.py
+++ b/py3status/modules/taskwarrior.py
@@ -3,7 +3,7 @@
Display currently active (started) taskwarrior tasks.
Configuration parameters:
- - cache_timeout : how often we refresh this module in seconds
+ - cache_timeout : how often we refresh this module in seconds (5s default)
Requires
- task
@@ -15,20 +15,23 @@ Requires
# import your useful libs here
from time import time
from subprocess import check_output
-import shlex
import json
+import shlex
class Py3status:
+ """
+ """
+ # available configuration parameters
cache_timeout = 5
def taskWarrior(self, i3s_output_list, i3s_config):
- command = "task start.before:tomorrow status:pending export"
+ command = 'task start.before:tomorrow status:pending export'
taskwarrior_output = check_output(shlex.split(command))
- tasks_json = json.loads("[" + taskwarrior_output + "]")
+ tasks_json = json.loads('[' + taskwarrior_output.decode('utf-8') + ']')
def describeTask(taskObj):
- return str(taskObj['id']) + " " + taskObj['description']
+ return str(taskObj['id']) + ' ' + taskObj['description']
result = ', '.join(map(describeTask, tasks_json))
response = {