omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    2
    5
    2236
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp last edited by cvp

      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 😇

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        looks like a bug
        https://github.com/omz/Pythonista-Issues/issues/21

        In the meantime, you could copy notification.py and add the missing n. in the line below to get_scheduled

        	info = {'message': n.message, 'fire_date': n.since1970, 'action_url': n.action_url, 'sound_name': n.sound_name}
        
        1 Reply Last reply Reply Quote 0
        • cvp
          cvp last edited by cvp

          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.

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            In previous versions, notification was based on c code _notification module. Several modules have been switched over to objc_util based approaches.

            1 Reply Last reply Reply Quote 0
            • cvp
              cvp last edited by

              One more time, thanks for your explanation

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors