File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1111from rich .table import Table
1212
1313import cmd2
14+ from cmd2 .colors import Color
1415
1516CITY_HEADERS = ['Flag' , 'City' , 'Country' , '2025 Population' ]
1617CITY_DATA = [
@@ -102,16 +103,16 @@ def do_countries(self, _: cmd2.Statement) -> None:
102103 table .add_row (* str_row )
103104
104105 # Make Population column blue
105- table .columns [2 ].header_style = "bold blue"
106- table .columns [2 ].style = "blue"
106+ table .columns [2 ].header_style = Color . BRIGHT_BLUE
107+ table .columns [2 ].style = Color . BLUE
107108
108109 # Make Density column red
109- table .columns [4 ].header_style = "bold red"
110- table .columns [4 ].style = "red"
110+ table .columns [4 ].header_style = Color . BRIGHT_RED
111+ table .columns [4 ].style = Color . RED
111112
112113 # Make GDB per capita column green
113- table .columns [6 ].header_style = "bold green"
114- table .columns [6 ].style = "green"
114+ table .columns [6 ].header_style = Color . BRIGHT_GREEN
115+ table .columns [6 ].style = Color . GREEN
115116
116117 self .poutput (table )
117118
You can’t perform that action at this time.
0 commit comments