diff --git a/octosuite/colors.py b/octosuite/colors.py index 67fed4c..e3bfd8e 100644 --- a/octosuite/colors.py +++ b/octosuite/colors.py @@ -1,4 +1,6 @@ +import psutil import platform +from richt.tree import Tree from datetime import datetime @@ -6,37 +8,43 @@ from datetime import datetime # This file gets called first at start up before any other file gets called # colors.py is the reason why users get to choose whether to enable/disable colors # delete this file, the entire program breaks -system_info = [("Processor",platform.processor), - ("Node", platform.node), - ("Release", platform.release), - ("Architecture", platform.architecture), - ("Version", platform.version)] -banner = f""" - OCTOSUITE © 2022 Richard Mwewa +system_info = [("RAM", f"{str(round(psutil.virtual_memory().total / (1024.0 ** 3)))}GB"), + ("Node", platform.node()), + ("Release", platform.release()), + ("Version", platform.version()), + ("Processor", platform.processor()), + ("Architecture", platform.architecture())] +first_banner = f""" + OCTOSUITE © 2023 Richard Mwewa {datetime.now().strftime('%A %d %B %Y, %H:%M:%S%p')} - - """ + +""" -print(banner) -print(f"\t{platform.system()}") -for key, value in system_info: - print(f"\t├─ {key}: {value()}") +print(first_banner) +system_tree = Tree(platform.system()) +for system_key, system_value in system_info: + system_tree.add(f"{system_key}: {system_value}") +xprint(system_tree) print("\n") while True: try: - color_chooser = input(f"[ ? ] Welcome, would you like to enable colors for this session? (Y/n) ").lower() - if color_chooser == "y": + color_chooser = input(f"[?] Welcome, would you like to enable colors for this session? (yes/no) ").lower() + if color_chooser == "yes": header_title = "bold white" red = "[red]" white = "[white]" + green = "[green]" + red_bold = "[white bold]" + white_bold = "[white bold]" green_bold = "[green bold]" reset = "[/]" break - elif color_chooser == "n": + elif color_chooser == "no": header_title = red = white = green = red_bold = white_bold = green_bold = reset = "" break else: - print(f"\n[ ! ] Your response '{color_chooser}' is invalid (expected y or n)") + print(f"\n[!] Your response '{color_chooser}' is invalid (expected yes or no)") except KeyboardInterrupt: - exit(f"[ ! ] Process interrupted with [Ctrl+C].") + exit(f"[!] Process interrupted with Ctrl+C.") +