From ed24f655243474fdef6652ea92959b13fc41c891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sun, 6 Mar 2016 00:50:04 +0100 Subject: Dump data as JSON pprint is not good for machine processing --- todoist | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/todoist b/todoist index 837ffb9..d028a2e 100755 --- a/todoist +++ b/todoist @@ -24,8 +24,6 @@ import json import todoist -from pprint import pprint - TOKEN_FILE_NAME = ".todoist_token" DUMP_FILENAME = "dump.txt" @@ -92,7 +90,7 @@ def store_token(token): def dump(data): with open(DUMP_FILENAME, mode="w") as f: - pprint(data, f) + f.write(json.dumps(data, ensure_ascii=False, indent=4)) def build_project_list(data): projects = { proj["name"].lower(): proj["id"] for proj in data["Projects"] } -- cgit v1.2.3