update
This commit is contained in:
+18
-19
@@ -22,6 +22,8 @@ from rich.table import Table
|
||||
from rich.text import Text
|
||||
import subprocess
|
||||
import pty
|
||||
# import win32console
|
||||
import multiprocessing
|
||||
|
||||
|
||||
#import from local file 4 main class
|
||||
@@ -42,7 +44,7 @@ console = Console()
|
||||
|
||||
|
||||
def stop_all():
|
||||
hprint("blue", "Arrêt d'enregistrement twitch.")
|
||||
hprint("blue", "Arrêt du bot twitch.")
|
||||
recordTw.stop()
|
||||
sb_translation.stop()
|
||||
ask_text.stop()
|
||||
@@ -65,7 +67,13 @@ def print_help():
|
||||
hprint("PURPLE", "Touche m : change le prompt a donner a l'ia")
|
||||
|
||||
|
||||
|
||||
def del_pathfile(file_path):
|
||||
try:
|
||||
os.remove(file_path)
|
||||
hprint("green", "Fichier Suprimé : " +file_path)
|
||||
except Exception as e:
|
||||
hprint("red", "del_file Error : "+ str(e))
|
||||
# Supprimer le fichier après le traitement
|
||||
|
||||
def start_keyboard_listener():
|
||||
global listening_keyboard # Déclare que tu utilises la variable globale
|
||||
@@ -138,6 +146,10 @@ def generation_responce():
|
||||
hprint("blue", "start IA_generator")
|
||||
ask_text.main_ask(text_streamer)
|
||||
|
||||
def print_Status_bar():
|
||||
print(f"\033[94mRecording time: 0{self.seconds}s | file : {self.loop}\033[0m", end='\r', flush=True) # Réinitialise la ligne à chaque fois
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -145,6 +157,10 @@ if __name__ == '__main__':
|
||||
global main_loop
|
||||
main_loop = True
|
||||
|
||||
del_pathfile("./working_bot/storage/IA_generator.json")
|
||||
del_pathfile("./working_bot/storage/subtitle_data.json")
|
||||
|
||||
|
||||
#configuration du dossier de travaille
|
||||
work_directory = "working_bot"
|
||||
if not os.path.exists(work_directory):
|
||||
@@ -184,23 +200,6 @@ if __name__ == '__main__':
|
||||
listener_thread.start() # mise en thread de l'écoute des appuye touche
|
||||
|
||||
|
||||
time.sleep(25)
|
||||
last_generaton = ""
|
||||
while main_loop:
|
||||
time.sleep(10)
|
||||
hprint("blue", "start main_loop main script / main_loop = "+str(main_loop))
|
||||
text_streamer = sb_translation.get_lasttext()
|
||||
ask_text.setnew_streamer_word_text(text_streamer)
|
||||
# new_genration = ask_text.getlast_generation()
|
||||
|
||||
# if new_genration != "" and new_genration != last_generaton:
|
||||
# hprint("blue", "Send message -> "+new_genration)
|
||||
# controluser.send_message(new_genration)
|
||||
# controluser.change_user()
|
||||
# last_generaton = new_genration
|
||||
# time.sleep(10)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user