Exemple #1
0
def do_cli(manager, options):
    if options.action == 'clear':
        num = clear_entries(options.task)
        console('%s entries cleared from backlog.' % num)
    else:
        cols = '{:<65.64}{:<15.15}'
        console(cols.format('Title', 'Task'))
        console('-' * 80)
        with Session() as session:
            entries = get_entries(options.task, session=session)
            for entry in entries:
                console(cols.format(entry.title, entry.task))
            if not entries:
                console('No items')
Exemple #2
0
def do_cli(manager, options):
    if options.action == 'clear':
        num = clear_entries(options.task)
        console('%s entries cleared from backlog.' % num)
    else:
        cols = '{:<65.64}{:<15.15}'
        console(cols.format('Title', 'Task'))
        console('-' * 80)
        with Session() as session:
            entries = get_entries(options.task, session=session)
            for entry in entries:
                console(cols.format(entry.title, entry.task))
            if not entries:
                console('No items')
Exemple #3
0
def do_cli(manager, options):
    if options.action == 'clear':
        num = plugin_backlog.clear_entries(options.task, all=True)
        console('%s entries cleared from backlog.' % num)
    else:
        header = ['Title', 'Task', 'Expires']
        table_data = [header]
        with Session() as session:
            entries = plugin_backlog.get_entries(options.task, session=session)
            for entry in entries:
                table_data.append([entry.title, entry.task, entry.expire.strftime('%Y-%m-%d %H:%M')])
        try:
            table = TerminalTable(options.table_type, table_data, wrap_columns=[0])
            console(table.output)
        except TerminalTableError as e:
            console('ERROR: %s' % str(e))
Exemple #4
0
def do_cli(manager, options):
    if options.action == "clear":
        num = clear_entries(options.task, all=True)
        console("%s entries cleared from backlog." % num)
    else:
        header = ["Title", "Task", "Expires"]
        table_data = [header]
        with Session() as session:
            entries = get_entries(options.task, session=session)
            for entry in entries:
                table_data.append([entry.title, entry.task, entry.expire.strftime("%Y-%m-%d %H:%M")])
        try:
            table = TerminalTable(options.table_type, table_data, wrap_columns=[0])
            console(table.output)
        except TerminalTableError as e:
            console("ERROR: %s" % str(e))