Syntax Error, Revert formatting errors, remove 308

This commit is contained in:
russellocean
2023-04-05 10:28:50 -04:00
committed by GitHub
parent c8c8f5b11e
commit c8a927d3ec

View File

@@ -301,45 +301,44 @@ while True:
except Exception as e: except Exception as e:
print_to_console("Error: \n", Fore.RED, str(e)) print_to_console("Error: \n", Fore.RED, str(e))
if not cfg.continuous_mode and next_action_count === 0: if not cfg.continuous_mode and next_action_count == 0:
### GET USER AUTHORIZATION TO EXECUTE COMMAND ### ### GET USER AUTHORIZATION TO EXECUTE COMMAND ###
# Get key press: Prompt the user to press enter to continue or escape # Get key press: Prompt the user to press enter to continue or escape
# to exit # to exit
if next_action_count == 0: user_input = ""
user_input = "" print_to_console(
print_to_console( "NEXT ACTION: ",
"NEXT ACTION: ", Fore.CYAN,
Fore.CYAN, f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}") print(
print( f"Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for {ai_name}...",
f"Enter 'y' to authorise command, 'y -N' to run N continuous commands, 'n' to exit program, or enter feedback for {ai_name}...", flush=True)
flush=True) while True:
while True: console_input = input(Fore.MAGENTA + "Input:" + Style.RESET_ALL)
console_input = input(Fore.MAGENTA + "Input:" + Style.RESET_ALL) if console_input.lower() == "y":
if console_input.lower() == "y": user_input = "GENERATE NEXT COMMAND JSON"
break
elif console_input.lower().startswith("y -"):
try:
next_action_count = abs(int(console_input.split(" ")[1]))
user_input = "GENERATE NEXT COMMAND JSON" user_input = "GENERATE NEXT COMMAND JSON"
break except ValueError:
elif console_input.lower().startswith("y -"): print("Invalid input format. Please enter 'y -n' where n is the number of continuous tasks.")
try: continue
next_action_count = abs(int(console_input.split(" ")[1])) break
user_input = "GENERATE NEXT COMMAND JSON" elif console_input.lower() == "n":
except ValueError: user_input = "EXIT"
print("Invalid input format. Please enter 'y -n' where n is the number of continuous tasks.") break
continue else:
break user_input = console_input
elif console_input.lower() == "n": command_name = "human_feedback"
user_input = "EXIT" break
break
else:
user_input = console_input
command_name = "human_feedback"
break
if user_input == "GENERATE NEXT COMMAND JSON": if user_input == "GENERATE NEXT COMMAND JSON":
print_to_console( print_to_console(
"-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=", "-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=",
Fore.MAGENTA, Fore.MAGENTA,
"") "")
elif user_input == "EXIT": elif user_input == "EXIT":
print("Exiting...", flush=True) print("Exiting...", flush=True)
break break