Fix invalid escape sequences.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/15/head
Slávek Banko 3 months ago
parent bde8dd4103
commit 13bfea6aff
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1437,9 +1437,9 @@ class CommandRunner(KDialogBase):
def slotReadyReadStdout(self):
# Remove the colors used by some programs.
# FIXME: this probably isn't neccessary anymore.
uncolor = lambda text: re.compile('\\x1b\[[0-9]+;01m').sub("", \
re.compile('\\x1b\[0m').sub("", re.compile('\\033\[1;[0-9]+m').sub("", \
re.compile('\\033\[0m').sub("", text))))
uncolor = lambda text: re.compile('\\x1b\\[[0-9]+;01m').sub("", \
re.compile('\\x1b\\[0m').sub("", re.compile('\\033\\[1;[0-9]+m').sub("", \
re.compile('\\033\\[0m').sub("", text))))
self.output += uncolor(str(self.kid.readStdout()))
self.outputtextview.setText(self.output)
self.outputtextview.ensureVisible(0,self.outputtextview.contentsHeight())

Loading…
Cancel
Save