本文整理匯總了Python中parsing.parser.Parser.line_to_event_dictionary方法的典型用法代碼示例。如果您正苦於以下問題:Python Parser.line_to_event_dictionary方法的具體用法?Python Parser.line_to_event_dictionary怎麽用?Python Parser.line_to_event_dictionary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類parsing.parser.Parser
的用法示例。
在下文中一共展示了Parser.line_to_event_dictionary方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: insert_spawn
# 需要導入模塊: from parsing.parser import Parser [as 別名]
# 或者: from parsing.parser.Parser import line_to_event_dictionary [as 別名]
def insert_spawn(self, spawn, player_name, active_ids: list = None):
"""Insert the events of a spawn into the Treeview"""
self.delete_all()
if len(spawn) == 0:
raise ValueError("Invalid spawn passed.")
spawn = spawn if isinstance(spawn[0], dict) else [Parser.line_to_dictionary(line) for line in spawn]
start_time = spawn[0]["time"]
active_ids = Parser.get_player_id_list(spawn) if active_ids is None else active_ids
for line in spawn:
if "custom" not in line or line["custom"] is False:
line_event_dict = Parser.line_to_event_dictionary(line, active_ids, spawn)
else:
line_event_dict = line
self.insert_event(line_event_dict, player_name, active_ids, start_time)