Optimize color stripping function a bit

This commit is contained in:
René Stadler 2007-11-19 11:35:27 +02:00 committed by Stefan Sauer
parent 5329d7503e
commit ef78287a70

View file

@ -103,7 +103,11 @@ debug_level_log = DebugLevel ("LOG")
_escape = re.compile ("\x1b\\[[0-9;]*m")
def strip_escape (s):
return _escape.sub ("", s)
# FIXME: This can be optimized further!
while "\x1b" in s:
s = _escape.sub ("", s)
return s
def default_log_line_regex_ ():