except KeyError: window['MATCHES'].update(values=[]) elif event == "BEST_STAKE": best_stakes_match_interface(window, values) elif event == "BEST_MATCH_FREEBET": best_match_freebet_interface(window, values) elif event == "BEST_MATCH_CASHBACK": best_match_cashback_interface(window, values) elif event == "BEST_MATCHES_COMBINE": sportsbetting.ODDS_INTERFACE = best_matches_combine_interface( window, values) elif not window_odds_active and event in [ "ODDS_COMBINE", "ODDS_STAKES", "ODDS_FREEBETS" ]: window_odds_active = True table = odds_table_combine(sportsbetting.ODDS_INTERFACE) layout_odds = [[ sg.Table(table[1:], headings=table[0], size=(None, 20)) ]] window_odds = sg.Window('Cotes', layout_odds) elif window_odds_active: ev2, vals2 = window_odds.Read(timeout=100) if ev2 is None or ev2 == 'Exit': window_odds_active = False window_odds.close() elif event == "ADD_STAKES": if visible_stakes < 9: window["SITE_STAKES_" + str(visible_stakes)].update(visible=True) window["STAKE_STAKES_" + str(visible_stakes)].update(visible=True) window["ODD_STAKES_" + str(visible_stakes)].update(visible=True) visible_stakes += 1
del sb.ODDS[sport_freebet[0]][match_freebet] elif event == "RELOAD_ODDS_FREEBET": sb.ODDS = load_odds(PATH_DATA) elif event == "BEST_MATCH_CASHBACK": best_match_cashback_interface(window, values) elif event == "BEST_MATCHES_COMBINE": def combine_thread(): best_matches_combine_interface(window, values) thread_combine = threading.Thread(target=combine_thread) thread_combine.start() window["PROGRESS_COMBINE"].update(0, 100, visible=True) elif not window_odds_active and event in ["ODDS_COMBINE", "ODDS_STAKES", "ODDS_FREEBETS", "ODDS_COMBI_OPT", "ODDS_COMBINE_GAGNANT"]: window_odds_active = True table = odds_table_combine(sb.ODDS_INTERFACE) layout_odds = [[sg.Table(table[1:], headings=table[0], size=(None, 20))]] window_odds = sg.Window('Cotes', layout_odds) elif window_odds_active: ev2, vals2 = window_odds.Read(timeout=100) if ev2 is None or ev2 == 'Exit': window_odds_active = False window_odds.close() elif event == "ADD_STAKES": if visible_stakes < 9: window["SITE_STAKES_" + str(visible_stakes)].update(visible=True) window["STAKE_STAKES_" + str(visible_stakes)].update(visible=True) window["ODD_STAKES_" + str(visible_stakes)].update(visible=True) visible_stakes += 1 elif event == "REMOVE_STAKES": if visible_stakes > 1: