コード例 #1
0
def complete_task(args):
    manager = TaskManager(fileio.load())
    ids = args.id
    if not ids:
        print(INVALID_ID_MSG)
    else:
        completed_tasks_dict = dict()
        for i in ids:
            try:
                completed_tasks_dict[i] = manager.task_dict[i]
                manager.complete(i)
                fileio.save(manager.task_dict)
            except KeyError:
                print(INVALID_ID_MSG)
        print_table(manager)
        print()
        print_completed_tasks(completed_tasks_dict)