debu stopping complet

This commit is contained in:
Foufure13
2025-01-10 15:53:17 +01:00
parent af359e9c70
commit a22a825704
12 changed files with 262 additions and 235 deletions
+14 -10
View File
@@ -45,6 +45,7 @@ def stop_all():
hprint("blue", "Arrêt d'enregistrement twitch.")
recordTw.stop()
sb_translation.stop()
ask_text.stop()
# signal_handler()
def print_help():
@@ -81,6 +82,7 @@ def stop_keyboard_listener():
def on_press(key):
global listening_keyboard
global main_loop
try:
if key == keyboard.Key.f5:
hprint("yellow", "Touche 'F5'BOT Active l'écoute clavier")
@@ -97,7 +99,7 @@ def on_press(key):
hprint("cyan", "Touche 'q' détectée. Fin du programme.")
stop_all()
main_loop = False
# return False # Cela arrêtera l'écouteur
return False # Cela arrêtera l'écouteur
elif key.char == 'c':
hprint("cyan", "Touche 'c' clear terminal")
clear_screen()
@@ -140,6 +142,7 @@ def generation_responce():
#----------------------------------------------------------------------------------------------------
if __name__ == '__main__':
global main_loop
main_loop = True
#configuration du dossier de travaille
@@ -169,8 +172,9 @@ if __name__ == '__main__':
sb_translation = Subtitle_translation("../config/config.json")
sb_translation.start_main_loop()
#ask_text = IA_generator("../config/config.json")
#ask_text.start_main_loop()
hprint("blue", "start loop IA_generator")
ask_text = IA_generator("../config/config.json")
ask_text.start_main_loop()
#controluser = messageTwitch(args.twitchname)
@@ -179,13 +183,13 @@ 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(3)
#hprint("blue", "start main_loop main script")
#text_streamer = sb_translation.get_lasttext()
#ask_text.setnew_streamer_word_text(text_streamer)
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: