djorge
Nov 09, 2017 - 11:36
Hi,
What is the best way to update the content load by a widget?
Let me explain:
I have a script that parses a pdf file and creates a file with data that is then loaded by my widget.
Whenever a receive a newer pdf file I parse it but I need to refresh my widget with the new data.
What I am doing is:
def refresh_data(self,sender):
shelve_file = shelve.open('data')
dia = shelve_file['dia']
v = appex.get_widget_view()
v = EmentaView(dia)
When this code is executed I get a message ‘could not load’, then I tap again the widget ant it refreshes the data.
In the end my widget appear refreshed but this is not the correct way due to the error message.