diff --git a/dzgui/const/constants.py b/dzgui/const/constants.py index 6c8a6092..6a67af5c 100644 --- a/dzgui/const/constants.py +++ b/dzgui/const/constants.py @@ -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" diff --git a/dzgui/model/model_factory.py b/dzgui/model/model_factory.py index a9292459..5ce35180 100644 --- a/dzgui/model/model_factory.py +++ b/dzgui/model/model_factory.py @@ -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 diff --git a/dzgui/util/strings.py b/dzgui/util/strings.py index 723cc3c7..eaeef34d 100644 --- a/dzgui/util/strings.py +++ b/dzgui/util/strings.py @@ -1,8 +1,3 @@ -# General -dz = "DayZ" -dz_exp = "DayZ Experimental" -delimiter = "␞" - # Wait dialogs ping = "Ping" mod = "Mod" diff --git a/dzgui/views/trees/tree_log.py b/dzgui/views/trees/tree_log.py index fd4279df..9f77300a 100644 --- a/dzgui/views/trees/tree_log.py +++ b/dzgui/views/trees/tree_log.py @@ -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