Some code cleanup and clarification in comments.

This commit is contained in:
Griatch 2009-08-28 01:33:15 +00:00
parent 2640bd057a
commit 4bd567386f
12 changed files with 351 additions and 66 deletions

View file

@ -144,3 +144,9 @@ def parse_ansi(string, strip_ansi=False, strip_formatting=False, parser=ANSI_PAR
"""
return parser.parse_ansi(string, strip_ansi=strip_ansi,
strip_formatting=strip_formatting)
def clean_ansi(string):
"""
Cleans all ansi symbols from a string
"""
r= re.compile("\033\[[0-9;]+m")
return r.sub("", string) #replace all matches with empty strings