Add forgotten file from previous commit.
This commit is contained in:
parent
2c81875019
commit
d16095c856
@ -158,6 +158,11 @@ def clen(string):
|
|||||||
return len(re.sub(r'\033[^m]*m', '', string))
|
return len(re.sub(r'\033[^m]*m', '', string))
|
||||||
|
|
||||||
|
|
||||||
|
def cextra(string):
|
||||||
|
""""Length of extra color characters in a string"""
|
||||||
|
return len(''.join(re.findall(r'\033[^m]*m', string)))
|
||||||
|
|
||||||
|
|
||||||
def cwrite(string, stream=sys.stdout, color=None):
|
def cwrite(string, stream=sys.stdout, color=None):
|
||||||
"""Replace all color expressions in string with ANSI control
|
"""Replace all color expressions in string with ANSI control
|
||||||
codes and write the result to the stream. If color is
|
codes and write the result to the stream. If color is
|
||||||
|
Loading…
Reference in New Issue
Block a user