2828__all__ = ["PacksManager" , "get_package_dir" ]
2929
3030
31+ class Styles :
32+ RESET = "\033 [0m"
33+ # styles
34+ BOLD = "\033 [1m"
35+ UNDER = "\033 [4m"
36+ # colors
37+ RED = "\033 [31m"
38+ GREEN = "\033 [32m"
39+ YELLOW = "\033 [33m"
40+ BLUE = "\033 [34m"
41+ MAGENTA = "\033 [35m"
42+ CYAN = "\033 [36m"
43+
44+
3145def get_package_dir (root_path = None ):
3246 """Get the package directory as a context manager.
3347
@@ -353,20 +367,19 @@ def install_pack(self, identifier: str | Path) -> None:
353367 def print_packs (self ) -> None :
354368 """Print information about available packs."""
355369 uninstalled_packs , installed_packs = [], []
370+ s = Styles ()
356371 for pack in self .available_packs ():
357372 if self .check_pack (pack ):
358373 installed_packs .append (pack )
359374 else :
360375 uninstalled_packs .append (pack )
361- print ("Installed Packs:" )
362- print ("----------------" )
376+ print (f"{ s .BOLD } { s .UNDER } { s .BLUE } Installed Packs:{ s .RESET } " )
363377 for pack in installed_packs :
364378 if not installed_packs :
365379 print (" (none)" )
366380 else :
367381 print (f" { pack } " )
368- print ("\n Available Packs:" )
369- print ("----------------" )
382+ print (f"\n { s .BOLD } { s .UNDER } { s .BLUE } Available Packs:{ s .RESET } " )
370383 if not uninstalled_packs :
371384 print (" (all packs installed)" )
372385 else :
@@ -375,11 +388,11 @@ def print_packs(self) -> None:
375388
376389 def print_examples (self ) -> None :
377390 """Print information about available examples."""
378- print ( " \n Examples:" )
379- print ("--------- " )
391+ s = Styles ( )
392+ print (f" \n { s . BOLD } { s . UNDER } { s . CYAN } Examples: { s . RESET } " )
380393 examples_dict = self .available_examples ()
381394 for pack , examples in examples_dict .items ():
382- print (f" { pack } :" )
395+ print (f" { s . BOLD } { pack } :{ s . RESET } " )
383396 for ex_name , _ in examples :
384397 print (f" - { ex_name } " )
385398
0 commit comments