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]))
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')
def done(task, config): """Mark a task is done from the todo list""" store = api_todo.Todo() store.done(task)
def delete(task, config): """Delete a task from the todo list""" store = api_todo.Todo() store.delete(task)
def add(task, priority, config): """Add a new task to the todo list""" store = api_todo.Todo() store.add(task, priority)