Fix cheat names and last error snippet (#52)
This commit is contained in:
parent
c79e1628cb
commit
fa431c1d4c
1 changed files with 9 additions and 2 deletions
|
@ -363,7 +363,7 @@ class LogAnalyser:
|
||||||
self._game_info["mods"] = "\n".join(mods_status)
|
self._game_info["mods"] = "\n".join(mods_status)
|
||||||
|
|
||||||
def __get_cheats(self):
|
def __get_cheats(self):
|
||||||
cheat_regex = re.compile(r"Tampering program\s<?(.+?)>?")
|
cheat_regex = re.compile(r"Tampering program\s<(.+)>")
|
||||||
matches = re.findall(cheat_regex, self._log_text)
|
matches = re.findall(cheat_regex, self._log_text)
|
||||||
if matches:
|
if matches:
|
||||||
cheats = [f"ℹ️ {match}" for match in matches]
|
cheats = [f"ℹ️ {match}" for match in matches]
|
||||||
|
@ -621,7 +621,7 @@ class LogAnalyser:
|
||||||
) -> dict[str, dict[str, str]]:
|
) -> dict[str, dict[str, str]]:
|
||||||
last_error = self.get_last_error()
|
last_error = self.get_last_error()
|
||||||
if last_error is not None:
|
if last_error is not None:
|
||||||
last_error = last_error[:2]
|
last_error = "\n".join(last_error[:2])
|
||||||
self._game_info["errors"] = f"```\n{last_error}\n```"
|
self._game_info["errors"] = f"```\n{last_error}\n```"
|
||||||
else:
|
else:
|
||||||
self._game_info["errors"] = "No errors found in log"
|
self._game_info["errors"] = "No errors found in log"
|
||||||
|
@ -659,6 +659,13 @@ class LogAnalyser:
|
||||||
def analyse(self) -> dict[str, Union[dict[str, str], list[str], list[list[str]]]]:
|
def analyse(self) -> dict[str, Union[dict[str, str], list[str], list[list[str]]]]:
|
||||||
self._notes = list(self.__sort_notes())
|
self._notes = list(self.__sort_notes())
|
||||||
|
|
||||||
|
last_error = self.get_last_error()
|
||||||
|
if last_error is not None:
|
||||||
|
last_error = "\n".join(last_error[:2])
|
||||||
|
self._game_info["errors"] = f"```\n{last_error}\n```"
|
||||||
|
else:
|
||||||
|
self._game_info["errors"] = "No errors found in log"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"hardware_info": self._hardware_info,
|
"hardware_info": self._hardware_info,
|
||||||
"emu_info": self._emu_info,
|
"emu_info": self._emu_info,
|
||||||
|
|
Loading…
Reference in a new issue