Skip to content

Commit

Permalink
fix the color management with rich
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Jan 8, 2024
1 parent b338b1c commit aa586f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cloudmesh/common/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def cprint(color="BLUE", prefix="", message=""):
message = message or ""
prefix = prefix or ""
#RichConsole.print(prefix + message, style=color.lower())
c = Console.theme[color]
c = Console.theme[color.upper()]
RichConsole.print(prefix + message, style=c)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_open(self):
if os_is_windows() and github_action:
pytest.skip('not supported')
Benchmark.Start()
filename = 'cloudmesh/common/console.py'
filename = 'src/cloudmesh/common/console.py'
Shell.open(filename)
Benchmark.Stop()
assert True # has to be a visual test!
Expand Down
5 changes: 2 additions & 3 deletions tests/test_shell_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ def test_shell_head(self):
file = path_expand('requirements.txt')
r = Shell.head(file)
Benchmark.Stop()
assert 'tqdm' in r
assert 'rich' in r
assert 'tabulate' in r
assert 'humanize' in r
assert 'oyaml' in r
r = Shell.head('requirements.txt', lines=1)
assert 'cloudmesh-sys' not in r

Expand Down

0 comments on commit aa586f0

Please sign in to comment.