Changed code to support older Python versions

This commit is contained in:
Malasaur 2025-12-01 23:27:09 +01:00
parent eb92d2d36f
commit 582458cdd0
5027 changed files with 794942 additions and 4 deletions

View file

@ -132,7 +132,7 @@ class LogsController:
def __init__(self):
self.log_file = Path(Config.LOG_FILE)
def stream(self) -> Generator[str]:
def stream(self):
with self.log_file.open() as f:
f.seek(0, 2)
while True:
@ -142,7 +142,7 @@ class LogsController:
else:
sleep(0.1)
def tail(self, back: int = 10) -> Generator[str]:
def tail(self, back: int = 10):
with self.log_file.open() as f:
for line in deque(f, maxlen=back):
yield line