Skip to content

Commit

Permalink
colored function instead of ANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
FadyCoding committed Jul 15, 2024
1 parent d662e77 commit 4e5a78a
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions debiaiServer/server.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
from threading import Timer
from termcolor import colored
import sys
from debiaiServer.websrv import start_server, open_browser
from debiaiServer.utils.utils import get_app_version
from debiaiServer.modules.dataProviders.pythonDataProvider.dataUtils import (
pythonModuleUtils,
)
from debiaiServer.config.init_config import DEBUG_COLOR, SUCCESS_COLOR

BRIGHT_CYAN = "\033[96m"
BRIGHT_GREEN = "\033[92m"
RESET = "\033[0m"

DATA_PATH = pythonModuleUtils.DATA_PATH


def print_bash_info():
def bash_info():
print(
f"{BRIGHT_CYAN}Usage:{RESET} debiai-gui [OPTIONS] COMMAND\n\n"
colored("Usage example:", DEBUG_COLOR) + "debiai-gui [OPTIONS] COMMAND\n\n"
"\t"
"Use the line below to run the app: \n\n"
"\t\t"
"$ debiai-gui"
f"{BRIGHT_GREEN} start{RESET}\n\n"
f"{BRIGHT_CYAN}Options:{RESET}\n"
"\t"
f"{BRIGHT_GREEN}--version {RESET} Prints DebiAI version number.\n"
f"{BRIGHT_CYAN}Commands:{RESET}\n"
"\t"
f"{BRIGHT_GREEN}start {RESET} Starts the DebiAI GUI and open it in a web browser.\n"
+ colored(" start\n\n")
+ colored("Options:\n", DEBUG_COLOR)
+ "\t"
+ colored("--version ", SUCCESS_COLOR)
+ "Prints DebiAI version number.\n"
+ colored("Commands:\n", DEBUG_COLOR)
+ "\t"
+ colored("start ", SUCCESS_COLOR)
+ " Starts the DebiAI GUI and open it in a web browser.\n"
)


Expand All @@ -37,8 +38,8 @@ def run():
start_server(reloader=False)
elif sys.argv[1] == "--version":
version = get_app_version()
print("DebiAI Version:" f"{BRIGHT_GREEN}{version}{RESET}")
print("DebiAI Version:" + colored(version, SUCCESS_COLOR))
else:
print_bash_info()
bash_info()
else:
print_bash_info()
bash_info()

0 comments on commit 4e5a78a

Please sign in to comment.