@@ -21,11 +21,11 @@ def __init__(self, *args, **kwargs):
21
21
22
22
# Create a custom theme
23
23
custom_theme = {
24
- Cmd2Style .SUCCESS : Style (color = Color .CYAN ),
25
- Cmd2Style .WARNING : Style (color = Color .MAGENTA ),
26
- Cmd2Style .ERROR : Style (color = Color .BRIGHT_RED ),
27
- Cmd2Style .HELP_HEADER : Style (color = Color .YELLOW ),
28
- Cmd2Style .HELP_LEADER : Style (color = Color . DARK_VIOLET , bgcolor = Color . BRIGHT_WHITE ),
24
+ Cmd2Style .SUCCESS : Style (color = Color .GREEN ),
25
+ Cmd2Style .WARNING : Style (color = Color .ORANGE1 ),
26
+ Cmd2Style .ERROR : Style (color = Color .PINK1 ),
27
+ Cmd2Style .HELP_HEADER : Style (color = Color .CYAN , bgcolor = "#44475a" ),
28
+ Cmd2Style .HELP_LEADER : Style (color = "#f8f8f2" , bgcolor = "#282a36" ),
29
29
Cmd2Style .TABLE_BORDER : Style (color = Color .LIGHT_SKY_BLUE1 ),
30
30
"argparse.args" : Style (color = Color .AQUAMARINE3 , underline = True ),
31
31
"inspect.attr" : Style (color = Color .DARK_GOLDENROD , bold = True ),
@@ -35,10 +35,12 @@ def __init__(self, *args, **kwargs):
35
35
@cmd2 .with_category ("Theme Commands" )
36
36
def do_theme_show (self , _ : cmd2 .Statement ):
37
37
"""Showcases the custom theme by printing messages with different styles."""
38
+ # NOTE: Using soft_wrap=False will ensure display looks correct when background colors are part of the style
38
39
self .poutput ("This is a basic output message." )
39
- self .psuccess ("This is a success message." )
40
- self .pwarning ("This is a warning message." )
41
- self .perror ("This is an error message." )
40
+ self .psuccess ("This is a success message." , soft_wrap = False )
41
+ self .pwarning ("This is a warning message." , soft_wrap = False )
42
+ self .perror ("This is an error message." , soft_wrap = False )
43
+ self .pexcept (ValueError ("This is a dummy ValueError exception." ))
42
44
43
45
44
46
if __name__ == "__main__" :
0 commit comments