diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-03-06 00:50:04 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-03-06 01:38:30 +0100 |
commit | ed24f655243474fdef6652ea92959b13fc41c891 (patch) | |
tree | 29bda4ecf2215269b7bcae45c41aeb8b10c13628 /todoist | |
parent | Move dump to separate function (diff) | |
download | todoist-ed24f655243474fdef6652ea92959b13fc41c891.tar.xz |
Dump data as JSON
pprint is not good for machine processing
Diffstat (limited to 'todoist')
-rwxr-xr-x | todoist | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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"] } |