diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 00:22:00 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 00:22:00 +0100 |
commit | fca5ab57513adbdbca677f0fb1d453db1285775f (patch) | |
tree | b4a95a737c644eae5fcfeb7b025258502b894ecd /todo | |
parent | c54f82293b824d725243fa5b4878b867c64bb04e (diff) | |
download | bin-fca5ab57513adbdbca677f0fb1d453db1285775f.tar.xz |
todo: add format_priority to color priority
Diffstat (limited to 'todo')
-rwxr-xr-x | todo | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -85,6 +85,17 @@ def color_blue(text): color_string = '\x1b[38;2;050;150;250m{}\x1b[0m' return color_string.format(text) +def format_priority(priority): + text = '({})'.format(priority) + if priority == 'A': + return color_red(text) + elif priority == 'B': + return color_yellow(text) + elif priority == 'C': + return color_blue(text) + else: + return text + def main(): arguments = docopt(__doc__, version='todo 0.0.1.alpha') config = parse_args(arguments) @@ -101,7 +112,7 @@ def main(): task = todo_dict[t_id] output = "{}. ".format(t_id) if 'priority' in task: - output += "({}) ".format(task['priority']) + output += '{} '.format(format_priority(task['priority'])) if 'date' in task: output += "{}".format(task['date']) if 'description' in task: |