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.
Any way to debbug today widgets?
-
Hi,
Is there a way to debug a today widget?In Pythonista app widget works as I want, but as a today widget sometimes works good, sometimes bad.
-
Not really... To be honest, if I could remove that feature without annoying a bunch of people, I probably would. Today widgets are just so extremely limited in memory that even just running the interpreter pushes it almost to its limits, and it becomes extremely likely that user scripts run into memory limitations very quickly... This is much less of an issue in Pythonista's other app extensions (the custom keyboard and share sheet) as those types of extensions get a more comfortable amount of RAM to work with.
-
For debugging widgets, you could e.g. write log files that you would read in the main app.
One general tip for widgets: In case you use
webbrowser.open()
in your widget, try removing thewebbrowser
import and useimport shortcuts; shortcuts.open_url(...)
instead. It's more efficient. -
Thank you for the answer.
Please, don't remove widgets.
I know they are limited and will modify my source in order to work.
Thanks.
-
Here is a screenshot of my widget - now it works almost perfect.
I have up-to-date information about free tennis courts.
-
-
And if it’s possible to send push notification about changes, it would be great.
-
@pavlinb, please clarify. What push notification, and which changes?
-
I mean It would be great if Pythonista today widget can send push notifications.
If you look on my screenshot f.e., in case there is a change of number of courts. -
@pavlinb did you try the notification module in your widget, only to see if it is supported in this mode?
-
@cvp I’m not 100% sure, because i have tried a lot of notifiers, but if I remember well, only time delay notifier works when main app ( Pythonista) is closed.
-
@pavlinb am i mistaken in thinking that a widget is only executed when it is in the foreground, so that the user sees the change, so does not need notification
-
@cvp You are right maybe. Obviously I need real application for such purposes, not today widget.
-
@omz Please, do not remove widgets!