Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
notification.get_scheduled() gives an error
-
notification.get_scheduled() gives an error "name message is not defined".
Checking notification.py shows that the get_schedule def uses "message" but I don't see any declaration.
Using notification.app.scheduledLocalNotifications() is ok.
More, if I print my notifications, I see their "fire date", "URL" but not their "message". Strange!
import notification #print(notification.get_scheduled()) scheduled = notification.app.scheduledLocalNotifications() for each in scheduled: print(each.alertBody()) # shows the message
Thanks to a guru to explain please 😇
-
looks like a bug
https://github.com/omz/Pythonista-Issues/issues/21In the meantime, you could copy notification.py and add the missing
n.
in the line below to get_scheduledinfo = {'message': n.message, 'fire_date': n.since1970, 'action_url': n.action_url, 'sound_name': n.sound_name}
-
Thanks a lot
Before Pythonista 3, I had used this get_scheduled without problem but if you check its source code in "standard library 2.7", the same error exists, it's strange.
-
In previous versions, notification was based on c code _notification module. Several modules have been switched over to objc_util based approaches.
-
One more time, thanks for your explanation