mirror of
https://github.com/aclist/dztui.git
synced 2026-11-23 09:59:36 +01:00
chore: move delimiter to constants
This commit is contained in:
1 parent
c63007475c
commit
c321a7c02f
4 files changed
+5
-9
No files matched your search
@@ -52,6 +52,7 @@ SYSTEM_LOG = f"{APP_NAME}_SYSTEM.LOG"
|
|||||||
CHANGELOG_PATH = "data/CHANGELOG.md"
|
CHANGELOG_PATH = "data/CHANGELOG.md"
|
||||||
IMAGES_PATH = "data/images"
|
IMAGES_PATH = "data/images"
|
||||||
ICONS_PATH = "data/images/gtk"
|
ICONS_PATH = "data/images/gtk"
|
||||||
|
LOG_DELIMITER = "␞"
|
||||||
|
|
||||||
HERO_PATH = "data/images/_hero.png"
|
HERO_PATH = "data/images/_hero.png"
|
||||||
CSS_PATH = "data/app.css"
|
CSS_PATH = "data/app.css"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Sequence, TYPE_CHECKING
|
from typing import Any, Sequence, TYPE_CHECKING
|
||||||
|
|
||||||
|
from dzgui.const.constants import LOG_DELIMITER
|
||||||
from dzgui.const.enum import HELP_MENU_ROWS
|
from dzgui.const.enum import HELP_MENU_ROWS
|
||||||
from dzgui.util.strings import delimiter
|
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ class ModelFactory:
|
|||||||
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
|
def new_model_from_logfile(self, path: "Path") -> FastInsertListStore:
|
||||||
store = self.make_log_store()
|
store = self.make_log_store()
|
||||||
with open(path, "r") as f:
|
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:
|
for record in lines:
|
||||||
store.append(record)
|
store.append(record)
|
||||||
return store
|
return store
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
# General
|
|
||||||
dz = "DayZ"
|
|
||||||
dz_exp = "DayZ Experimental"
|
|
||||||
delimiter = "␞"
|
|
||||||
|
|
||||||
# Wait dialogs
|
# Wait dialogs
|
||||||
ping = "Ping"
|
ping = "Ping"
|
||||||
mod = "Mod"
|
mod = "Mod"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import logging
|
|||||||
|
|
||||||
from typing import Any, TYPE_CHECKING
|
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.const.enum import ContextMenuGroup
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.util import strings
|
from dzgui.util import strings
|
||||||
@@ -92,7 +92,7 @@ class LogTreeView(ContextMixin, TreeView): # type: ignore
|
|||||||
for record in records:
|
for record in records:
|
||||||
raw_record = model[record]
|
raw_record = model[record]
|
||||||
els: tuple[Any] = tuple(raw_record) # type: ignore
|
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)
|
final.append(concat)
|
||||||
text = "\n".join(final)
|
text = "\n".join(final)
|
||||||
return text
|
return text
|
||||||
Reference in new issue
Block a user