Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hpc-team
spack
Commits
d16095c8
Commit
d16095c8
authored
Oct 13, 2015
by
Todd Gamblin
Browse files
Add forgotten file from previous commit.
parent
2c818750
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/spack/llnl/util/tty/color.py
View file @
d16095c8
...
...
@@ -158,6 +158,11 @@ def clen(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
):
"""Replace all color expressions in string with ANSI control
codes and write the result to the stream. If color is
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment