switched to colorama which works on Windows and in VS Code

This commit is contained in:
Nicholas Albion
2023-09-27 11:37:15 +10:00
parent 2073cfa2ed
commit 2cb76e6faf
4 changed files with 16 additions and 13 deletions

View File

@@ -67,7 +67,8 @@ class Project:
# if development_plan is not None:
# self.development_plan = development_plan
print(green_bold('\n------------------ STARTING NEW PROJECT ----------------------'))
# TODO: When running from the CLI, this would be displayed in addition to ---- LOADING PROJECT ----
print(green_bold('\n------------------ STARTING NEW PROJECT Project ----------------------'))
print(f"If you wish to continue with this project in future run:")
print(green_bold(f'python main.py app_id={args["app_id"]}'))
print(green_bold('--------------------------------------------------------------\n'))

View File

@@ -52,6 +52,7 @@ def get_arguments():
# Handle the error as needed, possibly exiting the script
else:
arguments['app_id'] = str(uuid.uuid4())
# TODO: This intro is also presented by Project.py. This version is not presented in the VS Code extension
print(colored('\n------------------ STARTING NEW PROJECT ----------------------', 'green', attrs=['bold']))
print("If you wish to continue with this project in future run:")
print(colored(f'python {sys.argv[0]} app_id={arguments["app_id"]}', 'green', attrs=['bold']))

View File

@@ -1,45 +1,45 @@
from termcolor import colored
from colorama import Fore, Style
def red(text):
return colored(text, 'red')
return f'{Fore.RED}{text}{Style.RESET_ALL}'
def red_bold(text):
return colored(text, 'red', attrs=['bold'])
return f'{Fore.RED}{Style.BRIGHT}{text}{Style.RESET_ALL}'
def yellow(text):
return colored(text, 'yellow')
return f'{Fore.YELLOW}{text}{Style.RESET_ALL}'
def yellow_bold(text):
return colored(text, 'yellow', attrs=['bold'])
return f'{Fore.YELLOW}{Style.BRIGHT}{text}{Style.RESET_ALL}'
def green(text):
return colored(text, 'green')
return f'{Fore.GREEN}{text}{Style.RESET_ALL}'
def green_bold(text):
return colored(text, 'green', attrs=['bold'])
return f'{Fore.GREEN}{Style.BRIGHT}{text}{Style.RESET_ALL}'
def blue(text):
return colored(text, 'blue')
return f'{Fore.BLUE}{text}{Style.RESET_ALL}'
def blue_bold(text):
return colored(text, 'blue', attrs=['bold'])
return f'{Fore.BLUE}{Style.BRIGHT}{text}{Style.RESET_ALL}'
def cyan(text):
return colored(text, 'light_cyan')
return f'{Fore.CYAN}{text}{Style.RESET_ALL}'
def white(text):
return colored(text, 'white')
return f'{Fore.WHITE}{text}{Style.RESET_ALL}'
def white_bold(text):
return colored(text, 'white', attrs=['bold'])
return f'{Fore.WHITE}{Style.BRIGHT}{text}{Style.RESET_ALL}'

View File

@@ -1,6 +1,7 @@
blessed==1.20.0
certifi==2023.5.7
charset-normalizer==3.2.0
colorama==0.4.6
distro==1.8.0
idna==3.4
jsonschema==4.19.1