bugfix logfile

This commit is contained in:
2022-05-19 17:30:05 -03:00
parent 3b26827c70
commit bbe381ed57
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -133,7 +133,8 @@ class node:
t = open(logfile, "r").read()
else:
t = logfile
t = t.replace("\n","",1).replace("\a","")
t = t.replace("\n","",1)
t = t.replace("\a","")
t = t.replace('\n\n', '\n')
t = re.sub(r'.\[K', '', t)
while True:
@@ -144,6 +145,7 @@ class node:
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/ ]*[@-~])')
t = ansi_escape.sub('', t)
t = t.lstrip(" \n\r")
t = t.replace("\r","")
if var == False:
d = open(logfile, "w")
d.write(t)