diff --git a/knockknock/desktop_sender.py b/knockknock/desktop_sender.py index 9b0010d..4aea957 100644 --- a/knockknock/desktop_sender.py +++ b/knockknock/desktop_sender.py @@ -5,7 +5,6 @@ import functools import socket import subprocess import platform -from win10toast import ToastNotifier DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -20,6 +19,11 @@ def desktop_sender(title: str = "knockknock"): subprocess.run(["notify-send", title, text]) elif platform.system() == "Windows": + try: + from win10toast import ToastNotifier + except ImportError as err: + print('Error: to use Windows Desktop Notifications, you need to install `win10toast` first. Please run `pip install win10toast==0.9`.') + toaster = ToastNotifier() toaster.show_toast(title, text, diff --git a/setup.py b/setup.py index c8b9800..dc08396 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from io import open setup( name='knockknock', - version='0.1.8', + version='0.1.8.1', description='Be notified when your training is complete with only two additional lines of code', long_description=open('README.md', 'r', encoding='utf-8').read(), long_description_content_type='text/markdown', @@ -26,7 +26,6 @@ setup( 'python-telegram-bot', 'requests', 'twilio', - 'win10toast==0.9' ], classifiers=[ 'Intended Audience :: Science/Research',