def start(self):
     app = QtGui.QApplication(sys.argv)
     self.main_window = QtGui.QWidget()
     self.main_window.resize(WINDOW_HEIGHT, WINDOW_WIDTH)
     self.main_window.setWindowTitle('Hockey probability app')
     app.setWindowIcon(QtGui.QIcon(join(dirname(sys.argv[0]), 'hokey.png')))
     self.main_layout = QtGui.QVBoxLayout()
     raw_data = get_raw_data(players_data_url, matches_data_url, headers)
     raw_data_with_tendencies = get_players_tendencies(raw_data)
     dump_player_stats(raw_data_with_tendencies)
     team_names = raw_data_with_tendencies.get('Tým').unique()
     self.data = FormulasRegistry.get_processed_data_for_all_formulas(raw_data_with_tendencies)
     team_combo_box_1 = teams_combo_box(team_names)
     team_combo_box_2 = teams_combo_box(team_names)
     team_combo_box_1.currentIndexChanged['QString'].connect(self.team_combo_box_callback('team1'))
     team_combo_box_2.currentIndexChanged['QString'].connect(self.team_combo_box_callback('team2'))
     buttons_layout = QtGui.QGridLayout()
     buttons_layout.addWidget(team_combo_box_1, 0, 0)
     buttons_layout.addWidget(team_combo_box_2, 0, 1)
     calculate_btn = QtGui.QPushButton('Calculate probabilities')
     calculate_btn.clicked.connect(self.calculate_btn_callback)
     self.tabs = construct_tabs({})
     self.main_layout.addWidget(self.tabs)
     self.main_layout.addLayout(buttons_layout)
     self.main_layout.addWidget(calculate_btn)
     self.team1 = team_combo_box_1.currentText()
     self.team2 = team_combo_box_2.currentText()
     self.main_window.setLayout(self.main_layout)
     self.main_window.show()
     sys.exit(app.exec_())
 def calculate_btn_callback(self):
     data_to_show = self.filter_data_to_show()
     self.tabs.setParent(None)
     self.tabs = construct_tabs(data_to_show)
     self.main_layout.insertWidget(0, self.tabs)