menusys package¶
Submodules¶
menusys.menusys module¶
# Updated By: Benjamin P. Trachtenberg # # Date Written 1/11/2015 # # # # Description: # # Menu system tools # # # ##########################################################
-
menusys.menusys.
chunk_up_string
(string_to_chunk, size_of_chunk=100)[source]¶ Function to chunk up a string, and make a list of chunks
Parameters: - string_to_chunk (String) – The string you want to chunk up
- size_of_chunk (Integer) – The size of the chunks in characters
Return type: List
Returns: A list containing the chunks.
-
menusys.menusys.
clear_screen
()[source]¶ Function to do a clear screen in Linux or Windows
Return type: None Returns: None it clears the screen
-
menusys.menusys.
make_menu_dict_from_dict
(orig_dict, dict_key_for_display)[source]¶ Function to create a menu dictionary with sub dictionary
Parameters: - orig_dict (Dict) – Dictionary you want to make a menu from
- dict_key_for_display (String) – Dictionary item to become the menu
Return type: Dict
Returns: A dictionary with menu and dictionary in line
-
menusys.menusys.
make_menu_dict_from_list
(orig_list)[source]¶ Function to create a menu dictionary from a list
Parameters: orig_list (List) – List you want to make a menu from Return type: Dict Returns: A dictionary with menu
-
menusys.menusys.
menu
(menu_dictionary, menu_header, back_function=None, no_quit=None, allow_sys_exit=None)[source]¶ Function to create a menu from a dictionary with a back option
Parameters: - menu_dictionary (Dict) – Dictionary in the following format {1: {‘MENU’: ‘Yes’}, 2: {‘MENU’: ‘No’}
- menu_header (String) – The header of the menu
- back_function (Function) – The callback Function
- no_quit (Boolean) – Set to True if you do not want a quit option
- allow_sys_exit (Boolean) – Set to true if you want the menu to quit the app, default returns q
Return type: String
Returns: The selected option
-
menusys.menusys.
menu_multi_select
(menu_dictionary, menu_header, back_function=None, no_quit=None, allow_sys_exit=None)[source]¶ Function to create a menu from a dictionary with a back option
Parameters: - menu_dictionary (Dict) – Dictionary in the following format {1: {‘MENU’: ‘Yes’}, 2: {‘MENU’: ‘No’}
- menu_header (String) – The header of the menu
- back_function (Function) – The callback Function
- no_quit (Boolean) – Set to True if you do not want a quit option
- allow_sys_exit (Boolean) – Set to true if you want the menu to quit the app, default returns q
Return type: List
Returns: The selected options in a list
Module contents¶
Init for menusys