Changed parser.strip_ansi to parser.strip_raw_codes for contexual clarity.
This commit is contained in:
parent
96f26098d1
commit
13dc71e02e
2 changed files with 4 additions and 4 deletions
|
|
@ -166,7 +166,7 @@ class ANSIParser(object):
|
||||||
else:
|
else:
|
||||||
return ANSI_NORMAL + ANSI_BLUE
|
return ANSI_NORMAL + ANSI_BLUE
|
||||||
|
|
||||||
def strip_ansi(self, string):
|
def strip_raw_codes(self, string):
|
||||||
"""
|
"""
|
||||||
Strips raw ANSI codes from a string.
|
Strips raw ANSI codes from a string.
|
||||||
"""
|
"""
|
||||||
|
|
@ -205,7 +205,7 @@ class ANSIParser(object):
|
||||||
if strip_ansi:
|
if strip_ansi:
|
||||||
# remove all ansi codes (including those manually
|
# remove all ansi codes (including those manually
|
||||||
# inserted in string)
|
# inserted in string)
|
||||||
return self.strip_ansi(parsed_string)
|
return self.strip_raw_codes(parsed_string)
|
||||||
|
|
||||||
# cache and crop old cache
|
# cache and crop old cache
|
||||||
_PARSE_CACHE[cachekey] = parsed_string
|
_PARSE_CACHE[cachekey] = parsed_string
|
||||||
|
|
@ -471,7 +471,7 @@ class ANSIString(unicode):
|
||||||
string = string._raw_string
|
string = string._raw_string
|
||||||
else:
|
else:
|
||||||
# It's a string that has been pre-ansi decoded.
|
# It's a string that has been pre-ansi decoded.
|
||||||
clean_string = parser.strip_ansi(string)
|
clean_string = parser._strip_raw_ansi(string)
|
||||||
|
|
||||||
if not isinstance(string, unicode):
|
if not isinstance(string, unicode):
|
||||||
string = string.decode('utf-8')
|
string = string.decode('utf-8')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue