read highlighters from settings.ini

This commit is contained in:
2021-10-29 11:53:47 +02:00
parent 5b9db22f39
commit d4db320e17
3 changed files with 69 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ from typing import List, Optional
from PyQt6.QtGui import QBrush, QColor, QPen
from highlight_regex import HighlightRegex
from highlighting import Highlighting
from line import Line
import os
from settings import Settings
@@ -20,14 +21,15 @@ class LogFileModel:
self._file = os.path.realpath(file)
self._lock = threading.RLock()
self.highlights = [
HighlightRegex(
re.compile("ERROR"),
brush=QBrush(QColor(220, 112, 122)),
pen=QPen(QColor(0, 0, 0)),
brush_full_line=QBrush(QColor(255, 112, 122))
)
]
self.highlights = Highlighting.read_config(settings)
# [
# HighlightRegex(
# re.compile("ERROR"),
# brush=QBrush(QColor(220, 112, 122)),
# pen=QPen(QColor(0, 0, 0)),
# brush_full_line=QBrush(QColor(255, 112, 122))
# )
# ]
def get_file(self):
return self._file