Exemplo n.º 1
0
 def parse_match(self, file: str, match_i: int):
     """
     Either adds sets the match and calls add_spawns to add the
     spawns found in the match or starts the results of all files
     found in the specified file and displays the results in the
     other frames.
     """
     print("[FileFrame] Parsing file '{}', match {}".format(file, match_i))
     self.main_window.middle_frame.statistics_numbers_var.set("")
     self.main_window.ship_frame.ship_label_var.set("No match or spawn selected yet.")
     lines = Parser.read_file(file)
     player_list = Parser.get_player_id_list(lines)
     file_cube, match_timings, _ = Parser.split_combatlog(lines, player_list)
     player_name = Parser.get_player_name(lines)
     match = file_cube[match_i]
     results = matchstats.match_statistics(file, match, match_timings[::2][match_i])
     self.update_widgets(*results)
     match_list = Parser.build_spawn_from_match(match)
     self.main_window.middle_frame.time_view.insert_spawn(match_list, player_name)
     match_timing = datetime.combine(Parser.parse_filename(file).date(), match_timings[::2][match_i].time())
     self.main_window.middle_frame.scoreboard.update_match(match_timing)
Exemplo n.º 2
0
 def parse_match(self, elements: list):
     """
     Either adds sets the match and calls add_spawns to add the
     spawns found in the match or starts the parsing of all files
     found in the specified file and displays the results in the
     other frames.
     :param elements: specifies file and match
     """
     self.clear_data_widgets()
     self.main_window.middle_frame.statistics_numbers_var.set("")
     self.main_window.ship_frame.ship_label_var.set("No match or spawn selected yet.")
     file_name, match_index = elements[0], int(elements[1])
     lines = Parser.read_file(file_name)
     player_list = Parser.get_player_id_list(lines)
     file_cube, match_timings, _ = Parser.split_combatlog(lines, player_list)
     player_name = Parser.get_player_name(lines)
     match = file_cube[match_index]
     results = matchstats.match_statistics(file_name, match, match_timings[::2][match_index])
     self.update_widgets(*results)
     match_list = Parser.build_spawn_from_match(match)
     self.main_window.middle_frame.time_view.insert_spawn(match_list, player_name)