diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-05-18 00:25:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 00:25:08 +0200 |
commit | 42bc319fd087ede6ab91b149608bbfc030b64890 (patch) | |
tree | 40f1269880df7267940c7b2728685d53b53cc536 /psutil/_common.py | |
parent | 135628639bd6d73b5e88aefe300acd13a04a858d (diff) | |
download | psutil-42bc319fd087ede6ab91b149608bbfc030b64890.tar.gz |
Wheels2 (#1761)
Diffstat (limited to 'psutil/_common.py')
-rw-r--r-- | psutil/_common.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/psutil/_common.py b/psutil/_common.py index b97bb01d..74366456 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -780,12 +780,13 @@ def term_supports_colors(file=sys.stdout): return True -def hilite(s, color="green", bold=False): +def hilite(s, color=None, bold=False): """Return an highlighted version of 'string'.""" if not term_supports_colors(): return s attr = [] - colors = dict(green='32', red='91', brown='33', yellow='93') + colors = dict(green='32', red='91', brown='33', yellow='93', blue='34', + violet='35', lightblue='36', grey='37', darkgrey='30') colors[None] = '29' try: color = colors[color] @@ -798,7 +799,7 @@ def hilite(s, color="green", bold=False): return '\x1b[%sm%s\x1b[0m' % (';'.join(attr), s) -def print_color(s, color="green", bold=False, file=sys.stdout): +def print_color(s, color=None, bold=False, file=sys.stdout): """Print a colorized version of string.""" if not term_supports_colors(): print(s, file=file) # NOQA |