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