diff options
-rwxr-xr-x | todoist | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -90,6 +90,10 @@ def store_token(token): with open(path, mode="w+") as f: f.write(token) +def dump(data): + with open(DUMP_FILENAME, mode="w") as f: + pprint(data, f) + def build_project_list(data): projects = { proj["name"].lower(): proj["id"] for proj in data["Projects"] } return projects @@ -148,8 +152,7 @@ def main(): sys.exit(1) if args.dump: - with open(DUMP_FILENAME, mode="w") as f: - pprint(data, f) + dump(data) sys.exit(0) ## Prepare data structures |