Exemplo n.º 1
0
def run_commands():
    commands.CreateBookmarksTableCommand().execute()
    return "Bookmarks Created!"
Exemplo n.º 2
0
               success_message='Bookmark deleted!'),
        'G':
        Option(
            'Import Github stars',
            commands.getGSCommand(),
            prep_call=get_github_import_options,
            success_message='Imported {result} bookmarks from starred repos!'),
        'Q':
        Option('Quit', commands.QuitCommand()),
    }

    clear_screen()
    print('Welcome to Bark!')

    print_options(options)

    chosen_option = get_option_choice(options)

    clear_screen()
    chosen_option.choose()  # <- ?????

    _ = input('Press ENTER to return to menu')


if __name__ == '__main__':

    commands.CreateBookmarksTableCommand().execute()

    while True:
        loop()
Exemplo n.º 3
0
def loop():
    while True:
        print_options()
        user_option = get_option_choice()
        print(user_option)
        user_option.choose()
        input('Press ENTER to return to menu')
        print()


if __name__ == '__main__':
    clear_screen()
    print('Welcome to bark!\n')

    command = commands.CreateBookmarksTableCommand()
    command.execute()

    options = {
        'a':
        Option('Add a bookmark',
               commands.AddBookmarkCommand(),
               prep_call=get_new_bookmark_data),
        'b':
        Option('List bookmarks by date', commands.ListBookmarkCommand()),
        'c':
        Option('List bookmarks by title',
               commands.ListBookmarkCommand(order_by='title')),
        'd':
        Option('Delete a bookmark',
               commands.DeleteBookmarkCommand(),