White space clean up and simplification of get_os_friendly_name.
This commit is contained in:
@@ -116,12 +116,10 @@ def get_os_friendly_name():
|
||||
os_name = platform.system()
|
||||
|
||||
if os_name == "Linux":
|
||||
return "Linux/"+distro.name(pretty=True)
|
||||
elif os_name == "Windows":
|
||||
return os_name
|
||||
os_name = "Linux/" + distro.name(pretty=True)
|
||||
elif os_name == "Darwin":
|
||||
return "Darwin/macOS"
|
||||
else:
|
||||
os_name = "Darwin/macOS"
|
||||
|
||||
return os_name
|
||||
|
||||
def call_open_ai(config, shell, query):
|
||||
@@ -166,7 +164,9 @@ def check_for_markdown(response):
|
||||
Odd corner case, sometimes ChatCompletion returns markdown
|
||||
"""
|
||||
if response.count("```",2):
|
||||
print(colored("The proposed command contains markdown, so I did not execute the response directly: \n", 'red')+response)
|
||||
print(colored(
|
||||
"The proposed command contains markdown, response not executed directly: \n", 'red'
|
||||
) + response)
|
||||
sys.exit(-1)
|
||||
|
||||
def missing_posix_display():
|
||||
@@ -243,7 +243,7 @@ def main():
|
||||
config = read_yaml_config()
|
||||
set_openai_api_key(config)
|
||||
|
||||
if (args.config):
|
||||
if args.config:
|
||||
print_config(config)
|
||||
|
||||
# Unix based SHELL (/bin/bash, /bin/zsh), otherwise assuming it's Windows
|
||||
|
||||
Reference in New Issue
Block a user