def get_choice_list_with_index(menu): choice_list = get_choice_list(menu) choice_list_with_index = {} for i in range(len(choice_list)): choice_list_with_index = dict_utils.set_value(choice_list_with_index, str(i + 1), choice_list[i] ) return choice_list_with_index
def set_action(choice, action): choice = dict_utils.set_value(choice, choice_const.ACTION, action) return choice
def set_question(menu, question): menu = dict_utils.set_value(menu, generic_const.QUESTION, question) return menu
def set_error_text(menu, error_text): menu = dict_utils.set_value(menu, menu_const.ERROR_TEXT, error_text) return menu
def set_choice_list(menu, choice_list): menu = dict_utils.set_value(menu, menu_const.CHOICE_LIST, choice_list) return menu
def set_text(element, text): element = dict_utils.set_value(element, generic_const.TEXT, text) return element
def set_id(element, element_id): element = dict_utils.set_value(element, generic_const.ID, element_id) return element