示例#1
0
def info(task, config):
    """Get task information from the todo list"""
    store = api_todo.Todo()
    result = store.info(task).fetchone()
    print("Id: {}".format(result[0]))
    print("Description: {}".format(result[1]))
    print("Created: {}".format(result[2]))
示例#2
0
def list(config):
    """List the todo list"""
    store = api_todo.Todo()
    #tasks = api_sort(store.ls())
    tasks = store.ls()
    headers = ['id', 'Priority', 'done', 'description']
    data = []
    for el in tasks:
        identifier, content, _, _, active, priority = el
        data.append([identifier, priority, "" if active else "X", content])
    console.show_table(data, headers, 'tasks')
示例#3
0
def done(task, config):
    """Mark a task is done from the todo list"""
    store = api_todo.Todo()
    store.done(task)
示例#4
0
def delete(task, config):
    """Delete a task from the todo list"""
    store = api_todo.Todo()
    store.delete(task)
示例#5
0
def add(task, priority, config):
    """Add a new task to the todo list"""
    store = api_todo.Todo()
    store.add(task, priority)