Exemplo n.º 1
0
    def __init__(self, modes):
        self.menu = ConsoleMenu("Scene Relighting Control")

        self.refresh_item = FunctionItem("Refresh frame info",
                                         lambda: self.force_main_menu_refresh)
        self.menu.append_item(self.refresh_item)

        # Camera controls: exposure and depth range.
        self.camera_menu = ConsoleMenu("Camera Control")
        self.camera_menu_item = SubmenuItem("Change camera settings",
                                            self.camera_menu,
                                            menu=self.menu)
        self.set_camera_exposure = FunctionItem("Set exposure",
                                                self.update_exposure)
        self.camera_menu.append_item(self.set_camera_exposure)
        self.exposure = 250
        self.depth_range = [1.0, 1.25]
        self.set_min_depth_item = FunctionItem(
            "Set min depth [%f]" % self.depth_range[0], self.set_min_depth)
        self.set_max_depth_item = FunctionItem(
            "Set max depth [%f]" % self.depth_range[1], self.set_max_depth)
        self.camera_menu.append_item(self.set_min_depth_item)
        self.camera_menu.append_item(self.set_max_depth_item)
        self.menu.append_item(self.camera_menu_item)

        # Mode selection
        self.modes = modes
        self.mode_name = self.modes[0]
        self.mode_menu = ConsoleMenu("Demo Modes",
                                     "Active mode: %s" % self.mode_name)
        self.mode_menu_item = SubmenuItem("Change demo mode",
                                          self.mode_menu,
                                          menu=self.menu)
        self.mode_items = []
        for key in self.modes:
            new_mode_item = FunctionItem("Set mode [%s]" % key,
                                         partial(self.set_mode, key))
            self.mode_items.append(new_mode_item)
            self.mode_menu.append_item(new_mode_item)
        self.menu.append_item(self.mode_menu_item)

        # Enable/display meshcat vis
        self.meshcat_vis_active = True
        self.toggle_meshcat_vis_item = FunctionItem("Disable meshcat vis",
                                                    self.toggle_meshcat_vis)
        self.menu.append_item(self.toggle_meshcat_vis_item)

        # Enable/disable face detection
        self.face_detection_active = True
        self.toggle_detector_item = FunctionItem("Disable face detector",
                                                 self.toggle_face_detector)
        self.menu.append_item(self.toggle_detector_item)

        # Adjust image save rate
        self.image_save_rate = 0
        self.set_image_save_rate_item = FunctionItem(
            "Set frame divider for image saving [curr %d]" %
            self.image_save_rate, self.set_image_save_rate)
        self.menu.append_item(self.set_image_save_rate_item)
        self.menu.start()
Exemplo n.º 2
0
def show_first_menu():
    # Record which models are in the models folder
    models_list = [
        f for f in listdir(models_path)
        if isfile(join(models_path, f)) and f[-4:] == ".dat"
    ]

    first_menu = ConsoleMenu("Main menu")

    submenu = SelectionMenu(models_list, "Load Model")
    submenu_item = SubmenuItem("Load a model",
                               submenu,
                               menu=first_menu,
                               should_exit=True)

    first_menu.append_item(submenu_item)

    first_menu.start()
    first_menu.join()

    if submenu.selected_option >= len(models_list):
        show_first_menu()
        return
    elif submenu.selected_option == -1:
        return

    selected_model = models_list[submenu.selected_option]

    net, jtree = util.load_model(models_path + selected_model)
    if net is not None and jtree is not None:
        jtree.initialize_tables(net)
        print("Model loaded succesfully")
        show_loaded_model_menu(selected_model, net, jtree)
    else:
        show_first_menu()
Exemplo n.º 3
0
def vm_menu():
    menu = ConsoleMenu("Virtual Machine", "Created with Python")

    submenu = ConsoleMenu("About Us")
    submenu.prologue_text = "This is Virtual Machine. Created by Vilnius Gediminas " \
          "Technical University PRIfs 18/6 student - Rimvydas Kanapka." \
                            " This program is created for Architecture of Computers and Computer Networks."

    menu.append_item(FunctionItem("Start VM", main))  # First menu item
    menu.append_item(SubmenuItem("About Us", submenu,
                                 menu=menu))  # Second menu item
    menu.show()
Exemplo n.º 4
0
def tm_menu():
    menu = ConsoleMenu("Turing Machine Simulator", "Created with Python")

    submenu = ConsoleMenu("About Us")
    submenu.prologue_text = "This is Turing Machine Simulator created by Vilnius Gediminas Technical University " \
                            "PRIfs 18/6 student - Rimvydas Kanapka." \
                            " This program is created for Architecture of Computers and Computer Networks."

    menu.append_item(FunctionItem("RUN Turing Machine",
                                  action))  # First menu item
    menu.append_item(SubmenuItem("About Us", submenu,
                                 menu=menu))  # Second menu item
    menu.show()
Exemplo n.º 5
0
 def test_init(self):
     root_menu = ConsoleMenu("root_menu", "test_init")
     submenu1 = ConsoleMenu("submenu1", "test_init")
     submenu2 = ConsoleMenu("submenu2", "test_init")
     submenu3 = ConsoleMenu("submenu2", "test_init")
     menu_item_1 = SubmenuItem("menu_item_1", submenu1)
     menu_item_2 = SubmenuItem("menu_item_2", submenu2, root_menu, True)
     menu_item_3 = SubmenuItem(text="menu_item_3", submenu=submenu3, menu=root_menu, should_exit=False)
     self.assertEqual(menu_item_1.text, "menu_item_1")
     self.assertEqual(menu_item_2.text, "menu_item_2")
     self.assertEqual(menu_item_3.text, "menu_item_3")
     self.assertIsNone(menu_item_1.menu)
     self.assertEqual(menu_item_2.menu, root_menu)
     self.assertEqual(menu_item_3.menu, root_menu)
     self.assertFalse(menu_item_1.should_exit)
     self.assertTrue(menu_item_2.should_exit)
     self.assertFalse(menu_item_3.should_exit)
     self.assertEqual(menu_item_1.submenu, submenu1)
     self.assertEqual(menu_item_2.submenu, submenu2)
     self.assertEqual(menu_item_3.submenu, submenu3)
     self.assertIsNone(menu_item_1.submenu.parent)
     self.assertEqual(menu_item_2.submenu.parent, root_menu)
     self.assertEqual(menu_item_3.submenu.parent, root_menu)
Exemplo n.º 6
0
    def test_(self):
        global title_text, subtitle_text, item_title_text
        menu_item = MenuItem(item_title, self.menu)

        # Test dynamic change of main menu title
        self.assertEqual(self.menu.get_title(), "title")
        title_text = "newtitle"
        self.assertEqual(self.menu.get_title(), "newtitle")

        # Test dynamic change of main menu subtitle
        self.assertEqual(self.menu.get_subtitle(), "subtitle")
        subtitle_text = "newsubtitle"
        self.assertEqual(self.menu.get_subtitle(), "newsubtitle")

        # Test dynamic menu item text
        self.assertEqual(menu_item.get_text(), "itemtext")
        item_title_text = "newtext"
        self.assertEqual(menu_item.get_text(), "newtext")

        # Test dynamic change of submenu item on each invocation
        submenu_item = SubmenuItem("a_sub", my_submenu_function)
        self.assertEqual(submenu_item.get_submenu().get_title(), "version1")
        self.assertEqual(submenu_item.get_submenu().get_title(), "version2")
Exemplo n.º 7
0
def utf_menu():
    menu = ConsoleMenu("Decimal number convertor & File Decoder",
                       "Created with Python")

    submenu = ConsoleMenu("About Us")
    submenu.prologue_text = "This is Decimal number convertor which takes a decimal number as a input and shows " \
          "number's Unicode, UTF-8 and single character. Created by Vilnius Gediminas " \
          "Technical University PRIfs 18/6 student - Rimvydas Kanapka." \
                            " This program is created for Architecture of Computers and Computer Networks."

    menu.append_item(
        FunctionItem("GET Unicode, UTF-8 & Char of a Decimal Number",
                     get_info))  # First menu item
    menu.append_item(FunctionItem("Decode File", decode))  # Second menu item
    menu.append_item(SubmenuItem("About Us", submenu,
                                 menu=menu))  # Third menu item
    menu.show()
Exemplo n.º 8
0
def output_console_menu():
    start_directory = os.getcwd()
    directory_content = get_directory_content(start_directory, False)
    file_selection_menu = ConsoleMenu("Select file from:", start_directory)
    for current_dir_item in directory_content:
        current_dir_item_path = start_directory + os.path.sep + current_dir_item
        if os.path.isfile(current_dir_item_path):
            file_selection_menu.append_item(FunctionItem(current_dir_item,
                                                         get_statistic,
                                                         [current_dir_item_path, tasks_list]))
        elif os.path.isdir(current_dir_item_path):
            current_sub_menu = ConsoleMenu("Select file from:", current_dir_item_path)
            for current_subdir_item in get_directory_content(current_dir_item_path, True):
                current_sub_menu.append_item(FunctionItem(current_subdir_item,
                                                          get_statistic,
                                                          [
                                                              current_dir_item_path + os.path.sep + current_subdir_item, tasks_list]))
            file_selection_menu.append_item(SubmenuItem(current_dir_item + os.path.sep, current_sub_menu))
    file_selection_menu.show()
Exemplo n.º 9
0
def main():

    if len(argv) < 2:
        menu = ConsoleMenu("Mechanism Types",
                           "Choose which mechanism you are characterizing")

        for mechanism, tools in tool_dict.items():
            tool_menu = ConsoleMenu(f"Characterization Tools: {mechanism}")
            for tool, function in tools.items():
                tool_menu.append_item(
                    FunctionItem(tool, function, menu=tool_menu))

            menu.append_item(SubmenuItem(mechanism, tool_menu, menu))

        menu.show()

    else:
        parser = argparse.ArgumentParser(
            description="FRC characterization tools CLI")
        parser.add_argument(
            "mech_type",
            choices=list(tool_dict.keys()),
            help="Mechanism type being characterized",
        )
        parser.add_argument(
            "tool_type",
            choices=list(list(tool_dict.values())[0].keys()),
            help=
            "Create new project, start data recorder/logger, or start data analyzer",
        )
        parser.add_argument(
            "project_directory",
            help=
            "Location for the project directory (if creating a new project)",
            nargs="?",
            default=None,
        )
        argcomplete.autocomplete(parser)

        args = parser.parse_args()
        tool_dict[args.mech_type][args.tool_type](
            directory=args.project_directory)
Exemplo n.º 10
0
    def test_action(self):
        root_menu = ConsoleMenu("root_menu", "test_action")
        submenu1 = ConsoleMenu("submenu1", "test_action")
        submenu2 = ConsoleMenu("submenu2", "test_action")
        submenu_item_1 = SubmenuItem("submenu_item_1", submenu1, menu=root_menu)
        submenu_item_2 = SubmenuItem("submenu_item_2", submenu2, menu=root_menu)

        root_menu.append_item(submenu_item_1)
        root_menu.append_item(submenu_item_2)

        root_menu.start()
        root_menu.wait_for_start(timeout=10)
        self.assertIs(ConsoleMenu.currently_active_menu, root_menu)
        submenu_item_1.action()
        submenu1.wait_for_start(timeout=10)
        self.assertIs(ConsoleMenu.currently_active_menu, submenu1)
        ConsoleMenu.currently_active_menu.exit()
        submenu1.join(timeout=10)
        self.assertIs(ConsoleMenu.currently_active_menu, root_menu)
        submenu_item_2.action()
        submenu2.wait_for_start(timeout=10)
        self.assertIs(ConsoleMenu.currently_active_menu, submenu2)
Exemplo n.º 11
0
def main():
    init()

    # Define main menu
    menu = ConsoleMenu(
        title="Music Library Manager",
        subtitle="Main Menu",
    )
    # Define add menu
    addMenu = ConsoleMenu(
        title="Music Library Manager",
        subtitle="Where would you like to add a new track?",
        exit_option_text="Back"
    )

    # Define main menu options
    opt_display = FunctionItem(
        "Display Music Library", wait_func, [displayLibrary])
    opt_add = SubmenuItem("Add a new track", addMenu)

    # Define add menu options
    opt_add_start = FunctionItem(
        "At the beginning of the list", wait_func, [addTune])

    # Add options to the main menu
    menu.append_item(opt_add)
    menu.append_item(opt_display)

    # Add options to the add menu
    addMenu.append_item(opt_add_start)

    # Display the menu and wait for user input
    menu.show()

    # Print when user runs the 'Exit' option
    print("Exiting...")
Exemplo n.º 12
0
menus = [
    (customer_menu, "Customer"),
    (order_menu, "Order"),
    (product_menu, "Product"),
    (seller_menu, "Seller"),
    (seller_product, "SellerProduct"),
]

for menu, string in menus:
    menu.append_item(FunctionItem("Find All", find_all, [string]))
    menu.append_item(FunctionItem("Exact search", find_exact, [string]))
    menu.append_item(FunctionItem("Like search", find_like, [string]))
    menu.append_item(FunctionItem("Insert", insert, [string]))
    menu.append_item(FunctionItem("Delete", delete, [string]))
    menu.append_item(FunctionItem("Update", update, [string]))
    menu.append_item(FunctionItem("Generate", generate, [string]))
    menu.append_item(FunctionItem("Clear", clear, [string]))

product_menu.append_item(
    FunctionItem("Find all sellers", find_exact,
                 ["SellerProduct", "product_id"]))
seller_menu.append_item(
    FunctionItem("Find all products", find_exact,
                 ["SellerProduct", "seller_id"]))
for menu, string in menus:
    main_menu.append_item(SubmenuItem(menu.title, menu, main_menu))

main_menu.append_item(FunctionItem("Generate all", generate))
main_menu.append_item(FunctionItem("Clear all", clear))
Exemplo n.º 13
0
from consolemenu import ConsoleMenu
from consolemenu.items import FunctionItem, SubmenuItem, CommandItem

menu = ConsoleMenu(title='Menu Title', subtitle='Subtitle')

command_item = CommandItem('Run a console command!', 'touch.txt')
function_item = FunctionItem('call a function', input, ['enter input'])

submenu = ConsoleMenu('a submenu')
submenu_item = SubmenuItem('show a submenu', submenu, menu=menu)

menu.append_item(command_item)
menu.append_item(function_item)
menu.append_item(submenu_item)

# menu.start()

# menu.join()

menu.show()

Exemplo n.º 14
0
mainMenuPrologue = "This program is designed to help the user organize and secure their scientific data."
mainMenuEpilogue = ""

lightsheetMenuTitle = "Lightsheet Data"
lightsheetPrologue = "This menu contains everything related to Lightsheet data."
lightsheetEpilogue = ""

mainMenu = ConsoleMenu(mainMenuTitle,
                       mainMenuSubTitle,
                       prologue_text=mainMenuPrologue,
                       epilogue_text=mainMenuEpilogue)
lightsheetMenu = ConsoleMenu(lightsheetMenuTitle,
                             prologue_text=lightsheetPrologue,
                             epilogue_text=lightsheetEpilogue,
                             exit_option_text="Main Menu")
lightsheetItem = SubmenuItem("Lightsheet Data", lightsheetMenu, mainMenu)
ephysMenu = ConsoleMenu("EPhys Data [Not Implemented]",
                        exit_option_text="Main Menu")
ephysItem = SubmenuItem("Ephys Data", ephysMenu, mainMenu)
confocalMenu = ConsoleMenu("Confocal Data [Not Implemented]",
                           exit_option_text="Main Menu")
confocalItem = SubmenuItem("Confocal Data", confocalMenu, mainMenu)
behaviorMenu = ConsoleMenu("Behavior Data [Not Implemented]",
                           exit_option_text="Main Menu")
behaviorItem = SubmenuItem("Behavior Data", behaviorMenu, mainMenu)
cellCultureMenu = ConsoleMenu("Cell Culture Data [Not Implemented]",
                              exit_option_text="Main Menu")
cellCultureItem = SubmenuItem("Cell Culture Data", cellCultureMenu, mainMenu)

openScanMenuItem = FunctionItem("Open Scan",
                                select_scan, [],
Exemplo n.º 15
0
def show_loaded_model_menu(model, net, jtree):
    # Record which models are in the models folder
    models_list = [
        f for f in listdir(models_path)
        if isfile(join(models_path, f)) and str(f)[-4:] == ".dat"
    ]

    menu = ConsoleMenu("Main menu - " + model)

    describe_bnet = FunctionItem("Describe Bayesian Net",
                                 function=lambda net: print(str(net)),
                                 args=[net])

    describe_jtree = FunctionItem("Describe Junction Tree",
                                  function=lambda jtree: print(str(jtree)),
                                  args=[jtree])

    visualize = FunctionItem(
        "Visualize Bayesian Net and Junction Tree",
        function=lambda path: os.system("visualize.py " + path),
        args=[models_path + model])

    propagate = FunctionItem(
        "Propagate evidence",
        function=lambda jtree:
        [jtree.sum_propagate(),
         print("Evidence propagated")],
        args=[jtree])

    load_new_model = SelectionMenu(models_list, "Load New Model")
    load_new_model_item = SubmenuItem("Load a new model",
                                      load_new_model,
                                      menu=menu,
                                      should_exit=True)

    add_evidence = FunctionItem("Add evidence",
                                function=add_evidence_option,
                                args=[jtree])
    get_probability = FunctionItem("Get probability of a variable",
                                   function=get_probability_option,
                                   args=[jtree])
    reset_model = FunctionItem(
        "Reset Model",
        function=lambda net, jtree:
        [jtree.initialize_tables(net),
         print("Tables reinitialized")],
        args=[net, jtree])

    menu.append_item(describe_bnet)
    menu.append_item(describe_jtree)
    menu.append_item(visualize)
    menu.append_item(add_evidence)
    menu.append_item(get_probability)
    menu.append_item(propagate)
    menu.append_item(reset_model)
    menu.append_item(load_new_model_item)

    menu.start()
    menu.join()

    if load_new_model.selected_option >= len(models_list):
        show_loaded_model_menu(model, net, jtree)
        return
    elif load_new_model.selected_option == -1:
        return

    selected_model = models_list[load_new_model.selected_option]
    net, jtree = util.load_model(models_path + selected_model)
    if net is not None and jtree is not None:
        jtree.initialize_tables(net)
        print("Model loaded succesfully")
        show_loaded_model_menu(selected_model, net, jtree)
    else:
        show_first_menu()
Exemplo n.º 16
0
    print("Github: https://github.com/DestinyofYeet/PasswordManager")
    input("\nEnter to continue")


"""
######################################### 'Main' Code #########################################
"""

if __name__ == '__main__':

    # Creates the main Menu
    menu = ConsoleMenu(f"Passwordmanager UI", "Select an option!")

    # Creates the submenu 'Passwordmanager menu'
    password_stuff = ConsoleMenu("Passwordmanager menu", "Select an option!")
    password_stuff_submenu = SubmenuItem("Passwordmanager menu",
                                         password_stuff, menu)

    # Creates the individual components of the submenu 'Passwordmanager menu'
    password_stuff.append_item(
        FunctionItem("Show all stored entries", show_database_entries))
    password_stuff.append_item(
        FunctionItem("Add database entry", create_database_entry))
    password_stuff.append_item(
        FunctionItem("Modify database entry", modify_database_entry))
    password_stuff.append_item(
        FunctionItem("Delete database entry", delete_database_entry))
    password_stuff.append_item(
        FunctionItem("Password generator", password_generator))

    # Creates the submenu 'Database menu'
    database_stuff = ConsoleMenu(f"Database menu", "Select an option!")
Exemplo n.º 17
0
                                               args='2')
buildMenuMining_FunctionDeuterium = FunctionItem('Deuterium Mine',
                                                 bot.build,
                                                 args='3')
buildMenuMining_FunctionEnergy = FunctionItem('Enery Plant',
                                              bot.build,
                                              args='4')

# ADD TO EACH MENU
buildMenu_Mining.append_item(buildMenuMining_FunctionMetal)
buildMenu_Mining.append_item(buildMenuMining_FunctionCrystal)
buildMenu_Mining.append_item(buildMenuMining_FunctionDeuterium)
buildMenu_Mining.append_item(buildMenuMining_FunctionEnergy)

# SUBMENUS BUILDING
subMenuMining = SubmenuItem('Mining Menu', buildMenu_Mining, buildMenu)
subMenuStructure = SubmenuItem('Structure Menu', buildMenu)
subMenuDefense = SubmenuItem('Defense Menu', buildMenu)
subMenuFleet = SubmenuItem('Fleet Menu', buildMenu)
buildSubMenu = SubmenuItem('Building Menu', buildMenu)

# SUBMENUS APPENDING TO MAIN MENU
buildMenu.append_item(subMenuMining)
buildMenu.append_item(subMenuStructure)
buildMenu.append_item(subMenuDefense)
buildMenu.append_item(subMenuFleet)

# Add Options to the menu
mainMenu.append_item(buildSubMenu)

# Shows menu
Exemplo n.º 18
0
gen_menu.append_item(FunctionItem('Bulk send', Client.bulk_send))
gen_menu.append_item(FunctionItem('User info', Client.user_info))
gen_menu.append_item(FunctionItem('Server list', Client.get_servers))
gen_menu.append_item(FunctionItem('Member list', Client.create_list))
gen_menu.append_item(FunctionItem('Download avatar', Client.download_avatar))

exploit_menu = ConsoleMenu('Exploits and misc features')
exploit_menu.append_item(
    FunctionItem('Infinite typing', create_task,
                 ['Infinite typing', Exploits.typing, 'Channel ID']))
exploit_menu.append_item(
    FunctionItem('Status changer', create_task,
                 ['Status changer', Exploits.status_changer]))
exploit_menu.append_item(FunctionItem('Friend finder', Exploits.friend_list))
exploit_menu.append_item(FunctionItem('Crash link', Exploits.crash_link))
exploit_menu.append_item(
    FunctionItem('Local Storage reassembly', Exploits.reassembly))

tasks_menu = ConsoleMenu('Terminate running tasks')

menu = ConsoleMenu('Discord Tool v0.1.3')
menu.append_item(FunctionItem('Info', Client.info))
menu.append_item(SubmenuItem('General', gen_menu, menu=menu))
menu.append_item(SubmenuItem('Exploits', exploit_menu, menu=menu))
menu.append_item(SubmenuItem('Tasks', tasks_menu, menu=menu))
menu.append_item(FunctionItem('About', about))
menu.formatter.set_items_bottom_padding(0)
menu.formatter.set_items_top_padding(0)
menu.formatter.set_title_align(align='center')

menu.show()
Exemplo n.º 19
0
def main():
    # Create the menu
    menu = ConsoleMenu(
        "Lena's Bank main menu",
        "Welcome to Lena's Bank! Please select from the following menu:")

    # A FunctionItem runs a Python function when selected
    list_of_all_customers_function = FunctionItem("List of all customers",
                                                  bank.list_of_all_customers)
    find_customer_function = FunctionItem("Find customer by SSN",
                                          bank.find_customer)
    update_customer_info_function = FunctionItem("Update customer info",
                                                 bank.update_customer)
    remove_customer_function = FunctionItem("Remove customer",
                                            bank.remove_customer)
    add_new_customer_function = FunctionItem("Add new customer",
                                             bank.add_new_customer)

    get_balance_function = FunctionItem("Get balance", bank.get_balance)
    open_new_account_function = FunctionItem("Open New Account",
                                             bank.open_new_account)
    close_account_function = FunctionItem("Close account", bank.close_account)

    add_new_transaction_function = FunctionItem("Add new transaction",
                                                bank.add_new_transaction)
    view_transaction_history_function = FunctionItem(
        "View transaction history", bank.transaction_history)

    list_of_all_customers_submenu_item = SelectionMenu([])
    list_of_all_customers_submenu_item.append_item(
        list_of_all_customers_function)
    list_of_all_customers_submenu_item.append_item(find_customer_function)
    list_of_all_customers_submenu_item.append_item(
        update_customer_info_function)
    list_of_all_customers_submenu_item.append_item(add_new_customer_function)
    list_of_all_customers_submenu_item.append_item(remove_customer_function)

    work_with_accounts_selection_menu = SelectionMenu([])
    work_with_accounts_selection_menu.append_item(get_balance_function)
    work_with_accounts_selection_menu.append_item(open_new_account_function)
    work_with_accounts_selection_menu.append_item(close_account_function)

    process_transactions_selection_menu = SelectionMenu([])
    process_transactions_selection_menu.append_item(
        add_new_transaction_function)
    process_transactions_selection_menu.append_item(
        view_transaction_history_function)

    manage_customers_submenu_item = SubmenuItem(
        "Manage customers", list_of_all_customers_submenu_item, menu)

    accounts_submenu_item = SubmenuItem("Work with accounts",
                                        work_with_accounts_selection_menu,
                                        menu)
    process_transactions_submenu_item = SubmenuItem(
        "Process Transactions", process_transactions_selection_menu, menu)

    menu.append_item(manage_customers_submenu_item)
    menu.append_item(accounts_submenu_item)
    menu.append_item(process_transactions_submenu_item)

    models.create_lenas_bank()
    menu.show()
Exemplo n.º 20
0
    m_notes.append_item(
        FunctionItem('Show notes', interface.wrapShow, ['notes']))

    m_related = ConsoleMenu('Sites')
    m_related.append_item(
        FunctionItem('Add new related site', interface.wrapAddRelated))
    m_related.append_item(
        FunctionItem('Remove existed related site', interface.wrapRemRelated))
    m_related.append_item(
        FunctionItem('Show related sites', interface.wrapShow, ['related']))

    m_structure = ConsoleMenu('Structure')
    m_structure.append_item(FunctionItem('Add new page',
                                         interface.wrapAddPage))
    m_structure.append_item(FunctionItem('Remove page', interface.wrapRemPage))
    m_structure.append_item(
        FunctionItem('Add parameter to page', interface.wrapAddArg))
    m_structure.append_item(
        FunctionItem('Remove parameter from page', interface.wrapRemArg))
    m_structure.append_item(
        FunctionItem('Change parameter on page', interface.wrapChangeArg))
    m_structure.append_item(
        FunctionItem('Show structure', interface.wrapShow, ['structure']))

    m_main.append_item(SubmenuItem('Notes', m_notes, menu=m_main))
    m_main.append_item(SubmenuItem('Related sites', m_related, menu=m_main))
    m_main.append_item(SubmenuItem('Structure', m_structure, menu=m_main))
    m_main.append_item(FunctionItem('Save project', interface.wrapSave))

    m_main.show()