From b6bf62b3531ef25b604933105079d28ea8b9a71b Mon Sep 17 00:00:00 2001 From: jorrick Date: Mon, 1 Aug 2022 22:57:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Python=20example=20was=20missing?= =?UTF-8?q?=20=5F=5Fname=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 ++++++++------- docs/index.md | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 468a086..a773966 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,14 @@ To use macos-notifications, first install it using pip: from functools import partial from mac_notifications import client -client.create_notification( - title="Meeting starts now!", - subtitle="Team Standup", - icon="/Users/jorrick/zoom.png", - action_button_str="Join zoom meeting", - action_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number) -) +if __name__ == "__main__": + client.create_notification( + title="Meeting starts now!", + subtitle="Team Standup", + icon="/Users/jorrick/zoom.png", + action_button_str="Join zoom meeting", + action_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number) + ) ``` A simple example. Please look [in the docs](https://jorricks.github.io/macos-notifications/) for more examples like this: diff --git a/docs/index.md b/docs/index.md index bb8b7a2..8e96f39 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,13 +50,14 @@ Installed from functools import partial from mac_notifications import client -client.create_notification( - title="Meeting starts now!", - subtitle="Team Standup", - icon="/Users/jorrick/zoom.png", - action_button_str="Join zoom meeting", - action_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number) -) +if __name__ == "__main__": + client.create_notification( + title="Meeting starts now!", + subtitle="Team Standup", + icon="/Users/jorrick/zoom.png", + action_button_str="Join zoom meeting", + action_callback=partial(join_zoom_meeting, conf_number=zoom_conf_number) + ) ``` A simple example. Please look [in the docs](https://jorricks.github.io/macos-notifications/) for more examples like this: