Improved boolean operators
This commit is contained in:
@@ -183,15 +183,19 @@ def prompt_user_input(config, response):
|
||||
print("Command: " + colored(response, 'blue'))
|
||||
#print(config["safety"])
|
||||
|
||||
if bool(config["safety"]) == True or ask_flag == True:
|
||||
if config["safety"]:
|
||||
prompt_text = "Execute command? [Y]es [n]o [m]odify [c]opy to clipboard ==> "
|
||||
|
||||
if os.name == "posix" and missing_posix_display():
|
||||
prompt_text = "Execute command? [Y]es [n]o [m]odify ==> "
|
||||
|
||||
print(prompt_text, end = '')
|
||||
|
||||
user_input = input()
|
||||
|
||||
return user_input
|
||||
|
||||
if config["safety"] == False:
|
||||
if not config["safety"]:
|
||||
return "Y"
|
||||
|
||||
def evaluate_input(user_input, command):
|
||||
@@ -237,12 +241,16 @@ def main():
|
||||
help='Print current configuration')
|
||||
args = parser.parse_args()
|
||||
|
||||
user_prompt = " ".join(args.text)
|
||||
ask_flag = args.safety
|
||||
|
||||
# Load configuration
|
||||
config = read_yaml_config()
|
||||
set_openai_api_key(config)
|
||||
|
||||
# Process parameters
|
||||
user_prompt = " ".join(args.text)
|
||||
|
||||
if args.safety:
|
||||
config["safety"] = args.safety
|
||||
|
||||
if args.config:
|
||||
print_config(config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user