Changed code to support older Python versions
This commit is contained in:
parent
eb92d2d36f
commit
582458cdd0
5027 changed files with 794942 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue