feat: make plyer an optional dependency

This commit is contained in:
Benex254
2024-09-22 21:50:41 +03:00
parent c6910e5a1c
commit 550fcfeddc
4 changed files with 45 additions and 6 deletions

View File

@@ -37,8 +37,13 @@ def exit_app(exit_code=0, *args):
console = Console()
if not console.is_terminal:
from plyer import notification
try:
from plyer import notification
except ImportError:
print(
"Plyer is not installed; install it for desktop notifications to be enabled"
)
exit(1)
notification.notify(
app_name=APP_NAME,
app_icon=ICON_PATH,