Skip to content

Commit a2b1aac

Browse files
PieterHugo Osvaldo Barrera
authored andcommitted
Create interactive command for curses interface
1 parent a91edc1 commit a2b1aac

File tree

2 files changed

+619
-0
lines changed

2 files changed

+619
-0
lines changed

todoman/cli.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import functools
22
import glob
3+
import logging
34
from datetime import timedelta
45
from os.path import expanduser, isdir
56

67
import click
78

89
from . import model
910
from .configuration import ConfigurationException, load_config
11+
from .interactive import TodomanInteractive
1012
from .model import Database, FileTodo
1113
from .ui import EditState, PorcelainFormatter, TodoEditor, TodoFormatter
1214

15+
16+
logging.basicConfig()
17+
logger = logging.getLogger()
18+
1319
TODO_ID_MIN = 1
1420
with_id_arg = click.argument('id', type=click.IntRange(min=TODO_ID_MIN))
1521

@@ -188,6 +194,16 @@ def edit(ctx, id, todo_properties, interactive):
188194
ctx.exit(1)
189195

190196

197+
@cli.command()
198+
@click.pass_context
199+
def interactive(ctx):
200+
'''
201+
Provide an interactive, curses-based interface to Todoman.
202+
'''
203+
TodomanInteractive(ctx.obj['db'], ctx.obj['formatter'])
204+
ctx.exit(1)
205+
206+
191207
@cli.command()
192208
@click.pass_context
193209
@with_id_arg

0 commit comments

Comments
 (0)