From f3ea3a108b0e7d1b137498a4e61f4fddde392724 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Wed, 11 Jul 2018 19:54:58 +0100 Subject: [PATCH] Add raw support for get_tasks function --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 3f0e3cc..492ea87 100755 --- a/bot.py +++ b/bot.py @@ -98,7 +98,7 @@ def set_property(property_name, value, chat_id): info_dict = file.write(json.dumps(info_dict)) -def get_tasks(chat_id): +def get_tasks(chat_id, raw=False): with open(config['tasks_file']) as file: tasks_dict = json.loads(file.read()) @@ -110,6 +110,9 @@ def get_tasks(chat_id): if chat_id not in tasks_dict: tasks_dict[chat_id] = "" + if raw: + return tasks_dict[chat_id] + tasks = [] for i in tasks_dict[chat_id].split('\n'): tasks.append(Task(i))