Add CLI command to list todoist project ids
This commit is contained in:
parent
612cf66c09
commit
b71692a41e
2 changed files with 19 additions and 0 deletions
14
actioner/cli/__init__.py
Normal file
14
actioner/cli/__init__.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import click
|
||||||
|
|
||||||
|
from actioner.clients import get_todoist_client
|
||||||
|
|
||||||
|
|
||||||
|
def list_todoist_projects():
|
||||||
|
todoist = get_todoist_client()
|
||||||
|
todoist.projects.sync()
|
||||||
|
|
||||||
|
for project in todoist.state["projects"]:
|
||||||
|
click.echo("'{}' has id {}".format(project["name"], project["id"]))
|
||||||
|
|
||||||
|
|
||||||
|
CLI_ENTRYPOINTS = [list_todoist_projects]
|
|
@ -5,6 +5,7 @@ import click
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from apscheduler.util import get_callable_name
|
from apscheduler.util import get_callable_name
|
||||||
|
|
||||||
|
from actioner.cli import CLI_ENTRYPOINTS
|
||||||
from actioner.scheduler import create_scheduler
|
from actioner.scheduler import create_scheduler
|
||||||
from actioner.settings import LOGGING_LEVEL, SENTRY_DSN
|
from actioner.settings import LOGGING_LEVEL, SENTRY_DSN
|
||||||
from actioner.web import get_server, run_server
|
from actioner.web import get_server, run_server
|
||||||
|
@ -33,5 +34,9 @@ def once():
|
||||||
job()
|
job()
|
||||||
|
|
||||||
|
|
||||||
|
for entry_point in CLI_ENTRYPOINTS:
|
||||||
|
cli.command()(entry_point)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cli()
|
cli()
|
||||||
|
|
Reference in a new issue