def preference_button(window, pre_dictionary, choice_dic, name):
    return_dictionary = {}
    for preference in list(choice_dic.keys()):
        return_dictionary[preference] = []
        i = 0
        for choice in choice_dic[preference]:
            if choice.get() == 1:
                return_dictionary[preference].append(pre_dictionary[preference][i])
            i += 1
    gL.add_preferences_to_user(name.get(), return_dictionary)
    start_menu.start_menu_window(window, name)
Example #2
0
def validateLogin(window, frame, name, pword):
    print(name.get(), pword.get())
    status = gL.login(name.get(), pword.get())
    if status == -1:
        Need = Label(frame,
                     text='User does not exist',
                     fg='red',
                     font='Ariel 8 bold')
        Need.grid(row=5, columnspan=2, pady=(10, 10))
    elif status == 0:
        preferences_page.preference_window(window, name)
    else:
        start_menu.start_menu_window(window, name)
Example #3
0
def validateLogin(window, frame, name, pword, fileBackground, fileBackground2):
    status = gL.login(name.get(), pword.get())
    # -1 - user does not exist, 0 - user ok but does not choose preferences, else- everything ok
    if status == -1:
        Need = Label(frame,
                     text='User does not exist',
                     fg='red',
                     bg="light blue",
                     font=("Comic Sans MS", 12))
        Need.grid(row=5, columnspan=2, pady=(5, 5))
    elif status == 0:
        preferences_page.preference_window(window, name, fileBackground,
                                           fileBackground2)
    else:
        start_menu.start_menu_window(window, name, fileBackground2)
Example #4
0
def preference_button(window, frame, pre_dictionary, choice_dic, name,
                      rowindex, fileBackground2):
    return_dictionary = {}
    for preference in list(choice_dic.keys()):
        return_dictionary[preference] = []
        i = 0
        for choice in choice_dic[preference]:
            if choice.get() == 1:
                return_dictionary[preference].append(
                    pre_dictionary[preference][i])
            i += 1
    # check if the list is empty
    if len(return_dictionary['Genre']) == 0:
        Need = Label(frame,
                     text='must choose Genre',
                     fg='red',
                     bg="white",
                     font=("Comic Sans MS", 12))
        Need.grid(row=rowindex + 2, columnspan=7, pady=(5, 5))
    else:
        # everything ok
        gL.add_preferences_to_user(name.get(), return_dictionary)
        # go to stare menu
        start_menu.start_menu_window(window, name, fileBackground2)
Example #5
0
def start(window, Gamer_name):
    start_menu.start_menu_window(window, Gamer_name)
Example #6
0
def start(window, Gamer_name, fileBackground2):
    start_menu.start_menu_window(window, Gamer_name, fileBackground2)