-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoasts.py
More file actions
14 lines (11 loc) · 721 Bytes
/
toasts.py
File metadata and controls
14 lines (11 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import platform
from win10toast import ToastNotifier
from constants.messageConstants import MessageConstants
from sanitize import sanitize
def toast(previouslyLiveStreams, refreshedLiveStreams):
if platform.release() == "10":
previouslyLiveStreamNames = [stream.stylizedStreamName for stream in previouslyLiveStreams]
streamsToToast = [stream for stream in refreshedLiveStreams if stream.stylizedStreamName not in previouslyLiveStreamNames]
for stream in streamsToToast:
toaster = ToastNotifier()
toaster.show_toast(MessageConstants.TOAST.format(stream.stylizedStreamName), sanitize(stream.streamTitle), threaded=False, icon_path='streamopenericon.ico', duration=8)