prepare filtering
This commit is contained in:
@@ -9,7 +9,8 @@ from settings import Settings
|
||||
class LogFileModel:
|
||||
_lock = threading.RLock()
|
||||
|
||||
def __init__(self, file):
|
||||
def __init__(self, file:str, settings: Settings):
|
||||
self.settings = settings
|
||||
self._file = os.path.realpath(file)
|
||||
|
||||
def get_file(self):
|
||||
@@ -43,7 +44,7 @@ class LogFileModel:
|
||||
# TODO handle lines longer than 4096 bytes
|
||||
with open(self._file, 'rb') as f:
|
||||
offset = min(byte_offset, self.byte_count())
|
||||
offset = max(0, offset - Settings.max_line_length())
|
||||
offset = max(0, offset - self.settings.max_line_length())
|
||||
|
||||
#print("offset: %s" % (offset))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user