mirror of
https://git.webmeisterei.com/webmeisterei/todoist-taskwarrior.git
synced 2023-12-21 10:23:00 +01:00
Add --no-sync option to disable todoist.sync()
This commit is contained in:
parent
b0f4ca3843
commit
48e7a5f6f5
13
migrate.py
13
migrate.py
@ -19,12 +19,15 @@ def cli(todoist_api_key):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option('-i', '--interactive', default=False)
|
@click.option('-i', '--interactive', default=False)
|
||||||
def migrate(interactive):
|
@click.option('--no-sync', is_flag=True, default=False)
|
||||||
important('Starting migration...')
|
def migrate(interactive, no_sync):
|
||||||
# todoist.sync()
|
if not no_sync:
|
||||||
tasks = todoist.items.all()
|
important('Syncing tasks with todoist... ', nl=False)
|
||||||
|
todoist.sync()
|
||||||
|
success('OK')
|
||||||
|
|
||||||
info(f'Todoist tasks: {len(todoist.items.all())}')
|
tasks = todoist.items.all()
|
||||||
|
important(f'Starting migration of {len(tasks)}...')
|
||||||
for task in todoist.items.all():
|
for task in todoist.items.all():
|
||||||
add_task(task)
|
add_task(task)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user