Exemplo n.º 1
0
def choose_block():
    Community.get_all_blocks()
    street, number = view.get_block_data()
    block = Community.find_block(street, number)
    if block:
        block_controller.block_menu(block)
    else:
        view.print_error_message()
Exemplo n.º 2
0
def main_menu():
    csv_path = 'community.csv'
    community = Community.create_from_csv(csv_path)
    view.welcome_screen(community.name)

    user_choice = ''
    while user_choice != '0':
        view.print_main_menu()
        user_choice = view.get_user_input()

        if user_choice == '1':
            Community.get_all_blocks()

        elif user_choice == '2':
            choose_block()

        elif user_choice == '3':
            add_new_block(community)

        elif user_choice == '4':
            # TODO find address by owner
            pass

    view.print_exit_message()