@@ -44,15 +44,15 @@ requires the user to specify a notification title and message. For instance:
4444import asyncio
4545from desktop_notifier import DesktopNotifier
4646
47- notify = DesktopNotifier()
47+ notifier = DesktopNotifier()
4848
4949async def main ():
50- n = await notify .send(title = " Hello world!" , message = " Sent from Python" )
50+ n = await notifier .send(title = " Hello world!" , message = " Sent from Python" )
5151
5252 await asyncio.sleep(5 ) # wait a bit before clearing notification
5353
54- await notify .clear(n) # removes the notification
55- await notify .clear_all() # removes all notifications for this app
54+ await notifier .clear(n) # removes the notification
55+ await notifier .clear_all() # removes all notifications for this app
5656
5757asyncio.run(main())
5858```
@@ -61,7 +61,7 @@ For convenience, the is also a synchronous method ``send_sync()`` to send notifi
6161which does not require a running asyncio loop:
6262
6363``` Python
64- notify .send_sync(title = " Hello world!" , message = " Sent from Python" )
64+ notifier .send_sync(title = " Hello world!" , message = " Sent from Python" )
6565```
6666
6767By default, "Python" will be used as the app name for all notifications, but you can
@@ -71,12 +71,13 @@ callbacks, etc. The following code will generate the notification shown in the g
7171the top of the page:
7272
7373``` Python
74+ import asyncio
7475from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField
7576
76- notify = DesktopNotifier()
77+ notifier = DesktopNotifier()
7778
7879async def main ():
79- await notify .send(
80+ await notifier .send(
8081 title = " Julius Caesar" ,
8182 message = " Et tu, Brute?" ,
8283 urgency = Urgency.Critical,
@@ -149,15 +150,16 @@ but may be convenient when developing a Gtk app.
149150
150151On macOS 10.14 and higher, the implementation uses the ` UNUserNotificationCenter `
151152instead of the deprecated ` NSUserNotificationCenter ` . ` UNUserNotificationCenter `
152- restricts sending desktop notifications to signed executables . This means that
153+ only allows signed executables to send desktop notifications . This means that
153154notifications will only work if the Python executable or bundled app has been signed.
154155Note that the installer from [ python.org] ( https://python.org ) provides a properly signed
155156Python framework but ** homebrew does not** (manually signing the executable installed
156157by homebrew _ should_ work as well).
157158
158- If you freeze your code with PyInstaller or a similar package, you must sign the
159- resulting app bundle for notifications to work. An ad-hoc signature will be sufficient
160- but signing with an Apple developer certificate is recommended for distribution.
159+ If you freeze your code with PyInstaller or a similar packaging solution, you must sign
160+ the resulting app bundle for notifications to work. An ad-hoc signature will be
161+ sufficient but signing with an Apple developer certificate is recommended for
162+ distribution and may be required on future releases of macOS.
161163
162164## Requirements
163165
0 commit comments