1
0
mirror of https://github.com/huggingface/knockknock.git synced 2021-08-28 00:30:42 +03:00

fix dependency error with win10toast (specific to windows)

This commit is contained in:
Victor SANH
2020-03-08 18:11:26 -04:00
parent 272ff3b9c3
commit 1e8d8e645e
2 changed files with 6 additions and 3 deletions

View File

@@ -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,

View File

@@ -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',