Skip to content

Commit

Permalink
Create interactive command for curses interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter committed Jan 10, 2017
1 parent 5f384f7 commit ad2b0f5
Show file tree
Hide file tree
Showing 3 changed files with 597 additions and 1 deletion.
13 changes: 13 additions & 0 deletions todoman/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
from .main import dump_idfile, get_task_sort_function, get_todo, get_todos
from .model import Database, Todo
from .ui import EditState, TodoEditor, TodoFormatter
from .interactive import TodomanInteractive

import logging
logging.basicConfig()
logger = logging.getLogger()

TODO_ID_MIN = 1
with_id_arg = click.argument('id', type=click.IntRange(min=TODO_ID_MIN))
Expand Down Expand Up @@ -179,6 +184,14 @@ def edit(ctx, id, todo_properties, interactive):
click.echo('No changes.')
ctx.exit(1)

@cli.command()
@click.pass_context
def interactive(ctx):
'''
Provide an interactive, curses-based interface to Todoman.
'''
TodomanInteractive(ctx.obj['db'].values(), ctx.obj['formatter'])
ctx.exit(1)

@cli.command()
@click.pass_context
Expand Down
Loading

0 comments on commit ad2b0f5

Please sign in to comment.