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 authored and Hugo Osvaldo Barrera committed Feb 18, 2017
1 parent a91edc1 commit a2b1aac
Show file tree
Hide file tree
Showing 2 changed files with 619 additions and 0 deletions.
16 changes: 16 additions & 0 deletions todoman/cli.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import functools
import glob
import logging
from datetime import timedelta
from os.path import expanduser, isdir

import click

from . import model
from .configuration import ConfigurationException, load_config
from .interactive import TodomanInteractive
from .model import Database, FileTodo
from .ui import EditState, PorcelainFormatter, TodoEditor, TodoFormatter


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 @@ -188,6 +194,16 @@ def edit(ctx, id, todo_properties, interactive):
ctx.exit(1)


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


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

0 comments on commit a2b1aac

Please sign in to comment.