Update app_launcher.py

added try to find_and_open_app in app_launcher.py
This commit is contained in:
maglore9900 2024-08-29 12:57:33 -04:00
parent ec07b096dc
commit 8ddc735d3f

View File

@ -55,6 +55,7 @@ class AppLauncher:
self.index_applications()
def find_and_open_app(self, app_name):
try:
match = get_close_matches(app_name.lower(), self.index.keys(), n=1, cutoff=0.6)
if match:
@ -63,5 +64,7 @@ class AppLauncher:
print(f"Opening {match[0]} at {app_path}")
else:
print(f"No matching application found for '{app_name}'")
except (FileNotFoundError, ValueError, KeyError):
print(f"Error opening application: {app_name}")