Exemplo n.º 1
0
def run_program():
    """Run program if usr executes RedList without any option"""
    while True:
        af.auto_fin()
        mode = [
            inquirer.List(
                'mode',
                message="Choose what you ganna do",
                choices=[
                    'Add todo', 'List todo', 'Modify todo', 'Delete todo',
                    'Show category', 'Quit'
                ],
            ),
        ]
        answers = inquirer.prompt(mode)
        if answers['mode'] == 'Add todo':
            at.add_todo()
        elif answers['mode'] == 'List todo':
            li.list_main()
        elif answers['mode'] == 'Modify todo':
            md.modify_todo()
        elif answers['mode'] == 'Delete todo':
            dl.del_todo()
        elif answers['mode'] == 'Show category':
            ctg.show_category()
        elif answers['mode'] == 'Quit':
            break
        af.auto_fin()
Exemplo n.º 2
0
def run_program():
	while True:
		print("Choose what to do")
		af.auto_fin()
		mode = [
			inquirer.List('mode',
				message="Choose what to do",
				choices=['Add todo', 'List todo', 'Modify todo', 'Delete todo', 'Show category', 'Quit'],
			),
		]
		answers = inquirer.prompt(mode)
		if answers['mode'] == 'Add todo':
			at.add_todo()
		elif answers['mode'] == 'List todo':
			li.list_main()
		elif answers['mode'] == 'Modify todo':
			md.modify_todo()
		elif answers['mode'] == 'Delete todo':
			dl.del_todo()
		elif answers['mode'] == 'Show category':
			ctg.show_category()
		elif answers['mode'] == 'Quit':
			break
		af.auto_fin()