Commit a12492ac authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Updated code for Kivy 1.10.0.

parent fbcf41b6
......@@ -18,9 +18,7 @@ class RestApp(App):
self.openmrs_connection = RESTConnection('localhost', 8080, 'admin', 'Admin123')
def load_locations(self):
results_layout = self.root.ids.results
for moribund in tuple(results_layout.children):
results_layout.remove_widget(moribund)
self.root.ids.results.clear_widgets()
self.openmrs_connection.send_request('location', None, self.on_locations_loaded,
self.on_locations_not_loaded, self.on_locations_not_loaded)
......@@ -30,8 +28,7 @@ class RestApp(App):
results_layout.add_widget(Label(text=result['display']))
def on_locations_not_loaded(self, request, error):
results_layout = self.root.ids.results
results_layout.add_widget(Label(text='[Failed to load locations]'))
self.root.ids.results.add_widget(Label(text='[Failed to load locations]'))
Logger.error('RestApp: {error}'.format(error=error))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment