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: