Code cleanup and improvements.

This commit is contained in:
2026-09-03 21:52:06 +02:00
parent ea323e3ab0
commit ecdea827ac
20 changed files with 312 additions and 213 deletions

View File

@@ -11,7 +11,7 @@ from typing import Iterable, Mapping
DEFAULT_NATIVE_LOG_PATTERNS = ("log_*.txt", "*.log")
_SCENE_RE = re.compile(
r"\[S1\]\s+after import\s+(?P<scene>[^:]+):\s*"
r"\[S1]\s+after import\s+(?P<scene>[^:]+):\s*"
r"materials=(?P<materials>\d+)\s+textures=(?P<textures>\d+)",
re.IGNORECASE,
)
@@ -24,14 +24,14 @@ _FAILED_IMPORT_RE = re.compile(
re.IGNORECASE,
)
_MODULE_CODE_SYNC_RE = re.compile(
r"Module Code Sync Error\s*\(\[(?P<left>-?\d+)\]\s*!=\s*"
r"\[(?P<right>-?\d+)\]\)",
r"Module Code Sync Error\s*\(\[(?P<left>-?\d+)]\s*!=\s*"
r"\[(?P<right>-?\d+)]\)",
re.IGNORECASE,
)
_TIMESTAMP_RE = re.compile(
r"^\s*(?:\[)?(?P<timestamp>"
r"^\s*\[?(?P<timestamp>"
r"\d{4}-\d{2}-\d{2}[T ][0-9:.+Z-]+|\d{2}:\d{2}:\d{2}(?:\.\d+)?)"
r"(?:\])?"
r"]?"
)
@@ -90,9 +90,6 @@ class NativeLogAnalysis:
return imports[-1]
return None
def first_event(self, kind: str) -> LogEvent | None:
return next((event for event in self.events if event.kind == kind), None)
def to_summary(self) -> dict[str, object]:
summary: dict[str, object] = {
"scenes": {