Skip to content

Commit

Permalink
do not change color to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Jan 8, 2024
1 parent 6f6c9cc commit b338b1c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cloudmesh/common/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import traceback

from rich.console import Console as RichConsole

# from cloudmesh.common.variables import Variables

RichConsole = RichConsole()


def is_powershell():
# this function is better than the one in util
# but not using that one since it is a circular import
Expand Down Expand Up @@ -73,8 +75,9 @@ class Console(object):
"RED": "red",
"ENDC": "default",
"BOLD": "bold",
"NORMAL": "default"
"NORMAL": "default",
}

if is_powershell():
for key in theme_color:
theme_color[key] = "bold " + theme_color[key]
Expand Down Expand Up @@ -358,7 +361,10 @@ def cprint(color="BLUE", prefix="", message=""):
"""
message = message or ""
prefix = prefix or ""
RichConsole.print(prefix + message, style=color.lower())
#RichConsole.print(prefix + message, style=color.lower())
c = Console.theme[color]
RichConsole.print(prefix + message, style=c)


@staticmethod
def text(color="RED", prefix=None, message=None):
Expand All @@ -375,7 +381,7 @@ def text(color="RED", prefix=None, message=None):
message = message or ""
prefix = prefix or ""
return Console.theme[color] + prefix + message + Console.theme["ENDC"]

@staticmethod
def background(msg, background_color="white", text_color="black"):
"""prints a message in a given background color
Expand Down

0 comments on commit b338b1c

Please sign in to comment.