本文整理匯總了Python中parsing.parser.Parser.count_matches方法的典型用法代碼示例。如果您正苦於以下問題:Python Parser.count_matches方法的具體用法?Python Parser.count_matches怎麽用?Python Parser.count_matches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類parsing.parser.Parser
的用法示例。
在下文中一共展示了Parser.count_matches方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update_files
# 需要導入模塊: from parsing.parser import Parser [as 別名]
# 或者: from parsing.parser.Parser import count_matches [as 別名]
def update_files(self):
"""Update the Calendar with the new files"""
self.clear_data_widgets()
self._dates.clear()
folder = variables.settings["parsing"]["path"]
if not os.path.exists(folder):
messagebox.showerror("Error",
"The specified CombatLogs folder does not exist. Please "
"choose a different folder.")
folder = filedialog.askdirectory()
variables.settings.write_settings({"parsing": {"path": folder}})
return self.update_files()
files = [f for f in os.listdir(folder) if Parser.get_gsf_in_file(f)]
self.create_splash(len(files))
match_count: Dict[datetime: int] = DateKeyDict()
for file in files:
date = Parser.parse_filename(file)
if date is None: # Failed to parse
continue
if date not in match_count:
match_count[date] = 0
match_count[date] += Parser.count_matches(file)
if date not in self._dates:
self._dates[date] = list()
self._dates[date].append(file)
self._splash.increment()
self._calendar.update_heatmap(match_count)
self.destroy_splash()