fixed some warnings in trade.py
This commit is contained in:
parent
e48abb9820
commit
0c4054d94f
@ -2,12 +2,13 @@ import time
|
||||
from .data import Message
|
||||
from . import gui
|
||||
from .data import log
|
||||
from io import TextIOWrapper
|
||||
|
||||
|
||||
def read_log(logfile: str, app: gui.Gui) -> None:
|
||||
try:
|
||||
logfile = open(logfile, 'r', encoding='utf8')
|
||||
loglines = follow(logfile)
|
||||
with open(logfile, 'r', encoding='utf8') as file:
|
||||
loglines = follow(file)
|
||||
for line in loglines:
|
||||
message = Message.from_text(line)
|
||||
log.debug(message)
|
||||
@ -18,7 +19,7 @@ def read_log(logfile: str, app: gui.Gui) -> None:
|
||||
log.error(f'Error opening log file {logfile}.')
|
||||
|
||||
|
||||
def follow(thefile: str):
|
||||
def follow(thefile: TextIOWrapper):
|
||||
thefile.seek(0, 2)
|
||||
while True:
|
||||
line = thefile.readline()
|
||||
|
Loading…
x
Reference in New Issue
Block a user