From 3e4aa6908cb22789b13786d9aa3a2021a94f4005 Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Sun, 3 Jun 2018 00:18:31 +0200 Subject: [PATCH] Instead of downloading pregenerated backup ZIPs (which now require a manual login they previously didn't), generate the backups, keeping the exact same ZIP layout, from the Todoist API, which still works correctly. --- README.md | 10 +- experiment-webapp/index.html | 2 +- .../backup_downloader.py | 39 +++--- todoist_full_offline_backup/controller.py | 49 +------- todoist_full_offline_backup/frontend.py | 32 +---- todoist_full_offline_backup/runtime.py | 8 +- .../integration_files/expected/BackupList.txt | 3 - .../expected/TodoistBackupNoAttach.zip | Bin 0 -> 3314 bytes ...-25 10_13.zip => TodoistBackupWAttach.zip} | Bin .../Project_2181147709.csv} | Bin 6201 -> 4497 bytes .../sources/Project_2181147711.csv | 1 + .../sources/Project_2181147712.csv | 1 + .../sources/Project_2181147713.csv | 1 + .../sources/Project_2181147714.csv | 1 + .../sources/Project_2181147715.csv | 1 + .../sources/Project_2181147955.csv | 4 + .../d786b8464e642890cd575bdefc87dcda.zip | Bin 6201 -> 0 bytes .../f9610a4296c5deaf536de3fc9bfd113a.zip | Bin 6317 -> 0 bytes .../sources/get_backups.json | 1 - .../sources/project_list.json | 91 ++++++++++++++ .../test_backup_attachments_downloader.py | 2 +- .../tests/test_backup_downloader.py | 77 +----------- .../tests/test_controller.py | 111 +++--------------- .../tests/test_frontend.py | 66 ++--------- .../tests/test_integration.py | 63 +++++----- .../tests/test_runtime.py | 4 - .../tests/test_todoist_api.py | 61 +++++----- todoist_full_offline_backup/todoist_api.py | 56 +++++---- todoist_full_offline_backup/utils.py | 2 +- 29 files changed, 253 insertions(+), 433 deletions(-) delete mode 100644 todoist_full_offline_backup/tests/integration_files/expected/BackupList.txt create mode 100644 todoist_full_offline_backup/tests/integration_files/expected/TodoistBackupNoAttach.zip rename todoist_full_offline_backup/tests/integration_files/expected/{TodoistBackupWAttach_2018-03-25 10_13.zip => TodoistBackupWAttach.zip} (100%) rename todoist_full_offline_backup/tests/integration_files/{expected/TodoistBackup_2018-03-25 10_12.zip => sources/Project_2181147709.csv} (63%) create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147711.csv create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147712.csv create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147713.csv create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147714.csv create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147715.csv create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/Project_2181147955.csv delete mode 100644 todoist_full_offline_backup/tests/integration_files/sources/d786b8464e642890cd575bdefc87dcda.zip delete mode 100644 todoist_full_offline_backup/tests/integration_files/sources/f9610a4296c5deaf536de3fc9bfd113a.zip delete mode 100644 todoist_full_offline_backup/tests/integration_files/sources/get_backups.json create mode 100644 todoist_full_offline_backup/tests/integration_files/sources/project_list.json diff --git a/README.md b/README.md index f9384e5..32811e6 100644 --- a/README.md +++ b/README.md @@ -40,17 +40,13 @@ Early version - enough for basic use, but not tested under every possible scenar ## Usage examples -Download latest backup from Todoist's servers, including attachments: +Create a backup from Todoist's servers, including attachments: -``python3 __main__.py download LATEST --with-attachments --token 0123456789abcdef`` - -Download a specific backup from Todoist's servers, without including attachments: - -``python3 __main__.py download "2018-02-16 06:46" --token 0123456789abcdef`` +``python3 __main__.py download --with-attachments --token 0123456789abcdef`` Download a specific backup from Todoist's servers, including attachments, and with tracing/progress info: -``python3 __main__.py --verbose download "2018-02-16 06:46" --token 0123456789abcdef`` +``python3 __main__.py --verbose download --token 0123456789abcdef`` List available backups: diff --git a/experiment-webapp/index.html b/experiment-webapp/index.html index c33e8e6..7198e6c 100644 --- a/experiment-webapp/index.html +++ b/experiment-webapp/index.html @@ -7,7 +7,7 @@