-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
import time | ||
from pathlib import Path | ||
|
||
from mac_notifications import client | ||
|
||
|
||
if __name__ == "__main__": | ||
print(f"Active number of notifications: {client.get_notification_manager().get_active_running_notifications()}") | ||
print("Sending meeting notification.") | ||
client.create_notification( | ||
title="Action notification", | ||
subtitle="Subtitle of the notification", | ||
action_button_str="Perform an action", | ||
action_callback=lambda: print("Pressed action button"), | ||
title="Meeting starts now.", | ||
subtitle="Standup Data Team", | ||
icon=Path(__file__).parent / "img" / "zoom.png", | ||
action_button_str="Join zoom meeting", | ||
action_callback=lambda: print("Joining zoom meeting now."), | ||
) | ||
|
||
time.sleep(1) | ||
time.sleep(5) | ||
print("Sending notification.") | ||
client.create_notification( | ||
title="Reply notification", | ||
subtitle="Subtitle of the notification", | ||
title="Message from Henk", | ||
subtitle="Hey Dude, are we still meeting?", | ||
icon=Path(__file__).parent / "img" / "chat.png", | ||
reply_button_str="Reply to this notification", | ||
reply_callback=lambda reply: print(f"Replied {reply=}"), | ||
reply_callback=lambda reply: print(f"You replied: {reply}"), | ||
) | ||
|
||
print("Application will remain active until both notifications have been answered.") | ||
while client.get_notification_manager().get_active_running_notifications() > 0: | ||
time.sleep(1) | ||
print(f"Active number of notifications: {client.get_notification_manager().get_active_running_notifications()}") | ||
client.stop_listening_for_callbacks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters