chore: move delimiter to constants

This commit is contained in:
aclist committed 2026-11-23 17:44:46 +09:00
1 parent c63007475c
commit c321a7c02f
4 files changed
+5 -9

No files matched your search

+1
View File
@@ -52,6 +52,7 @@ SYSTEM_LOG = f"{APP_NAME}_SYSTEM.LOG"
CHANGELOG_PATH = "data/CHANGELOG.md"
IMAGES_PATH = "data/images"
ICONS_PATH = "data/images/gtk"
LOG_DELIMITER = "␞"
HERO_PATH = "data/images/_hero.png"
CSS_PATH = "data/app.css"
+2 -2
View File
@@ -1,8 +1,8 @@
from dataclasses import dataclass
from typing import Any, Sequence, TYPE_CHECKING
from dzgui.const.constants import LOG_DELIMITER
from dzgui.const.enum import HELP_MENU_ROWS
from dzgui.util.strings import delimiter
import gi
@@ -131,7 +131,7 @@ class ModelFactory:
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
store = self.make_log_store()
with open(path, "r") as f:
lines = [line.split(delimiter) for line in f.read().splitlines()]
lines = [line.split(LOG_DELIMITER) for line in f.read().splitlines()]
for record in lines:
store.append(record)
return store
-5
View File
@@ -1,8 +1,3 @@
# General
dz = "DayZ"
dz_exp = "DayZ Experimental"
delimiter = "␞"
# Wait dialogs
ping = "Ping"
mod = "Mod"
+2 -2
View File
@@ -2,7 +2,7 @@ import logging
from typing import Any, TYPE_CHECKING
from dzgui.const.constants import APP_NAME, LOG_FILTERS
from dzgui.const.constants import APP_NAME, LOG_DELIMITER, LOG_FILTERS
from dzgui.const.enum import ContextMenuGroup
from dzgui.model.model_factory import ModelFactory
from dzgui.util import strings
@@ -92,7 +92,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
for record in records:
raw_record = model[record]
els: tuple[Any] = tuple(raw_record) # type: ignore
concat = strings.delimiter.join(map(str, els))
concat = LOG_DELIMITER.join(map(str, els))
final.append(concat)
text = "\n".join(final)
return text