Example #1
0
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
Example #2
0
def set_action(choice, action):
    choice = dict_utils.set_value(choice, choice_const.ACTION, action)
    return choice
Example #3
0
def set_question(menu, question):
    menu = dict_utils.set_value(menu, generic_const.QUESTION, question)
    return menu
Example #4
0
def set_error_text(menu, error_text):
    menu = dict_utils.set_value(menu, menu_const.ERROR_TEXT, error_text)
    return menu
Example #5
0
def set_choice_list(menu, choice_list):
    menu = dict_utils.set_value(menu, menu_const.CHOICE_LIST, choice_list)
    return menu
Example #6
0
def set_text(element, text):
    element = dict_utils.set_value(element, generic_const.TEXT, text)
    return element
Example #7
0
def set_id(element, element_id):
    element = dict_utils.set_value(element, generic_const.ID, element_id)
    return element