You've already forked Irene-Voice-Assistant
mirror of
https://github.com/janvarev/Irene-Voice-Assistant.git
synced 2025-12-05 23:08:23 +02:00
Замена ручного указания ANSI Escape Codes на использование библиотеки termcolor
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
from fastapi import FastAPI, HTTPException
|
from fastapi import FastAPI, HTTPException
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
|
from termcolor import cprint
|
||||||
|
|
||||||
#from pydantic import BaseModel
|
#from pydantic import BaseModel
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ def core_update_timers_http(runReq=True):
|
|||||||
@app.on_event("shutdown")
|
@app.on_event("shutdown")
|
||||||
def app_shutdown():
|
def app_shutdown():
|
||||||
global is_running
|
global is_running
|
||||||
print("\033[93m{}\033[00m" .format("Ctrl-C pressed, exiting Irene."))
|
cprint("Ctrl-C pressed, exiting Irene.", "yellow")
|
||||||
is_running = False
|
is_running = False
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
import traceback
|
import traceback
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
from termcolor import colored, cprint
|
||||||
import time
|
import time
|
||||||
from threading import Timer
|
from threading import Timer
|
||||||
|
|
||||||
@@ -402,10 +403,10 @@ class VACore(JaaCore):
|
|||||||
self.format_print_key_list("TTS engines", self.ttss.keys())
|
self.format_print_key_list("TTS engines", self.ttss.keys())
|
||||||
self.format_print_key_list("Assistant names", self.voiceAssNames)
|
self.format_print_key_list("Assistant names", self.voiceAssNames)
|
||||||
|
|
||||||
print("\033[34m{}\033[00m".format("Commands list: "+"#"*65))
|
cprint("Commands list: "+"#"*65, "blue")
|
||||||
for plugin in self.plugin_commands:
|
for plugin in self.plugin_commands:
|
||||||
self.format_print_key_list(plugin, self.plugin_commands[plugin])
|
self.format_print_key_list(plugin, self.plugin_commands[plugin])
|
||||||
print("\033[34m{}\033[00m".format("#"*80))
|
cprint("#"*80, "blue")
|
||||||
|
|
||||||
def format_print_key_list(self, key:str, value:list):
|
def format_print_key_list(self, key:str, value:list):
|
||||||
print("\033[34m{}: \033[00m".format(key)+", ".join(value))
|
print(colored(key+": ", "blue")+", ".join(value))
|
||||||
|
|||||||
Reference in New Issue
Block a user