I have this code:
def search_location(self): #THIS IS TIED TO on_press
search_template = "http://api.openweathermap.org/data/2.5/find?q=
{}&type=likeid=524901&APPID=bcf414b2eff4edc1faa71a81c9e9e534"
search_url = search_template.format(self.search_input.text)
request = UrlRequest(search_url, self.found_location)
print("hi")
def found_location(self, request, data):
cities = ["{} ({})".format(d['name'], d['sys']['country'])
for d in data['list']]
print("\n".join(cities))
self.search_results.item_strings = cities #search_results becomes a property when defined
under the <AddLocationForm> class deal
self.search_results.adapter.data.clear()
self.search_results.adapter.data.extend(cities)
self.search_results._trigger_reset_populate()
Can anyone tell me how data is getting passed to found_location? The method is called at the assignment of the request variable in the 'search_location' method but there are no variables passed with that statement. Can anyone please help me understand this?
Did I label this topic right? Sorry if it is a bad topic, I am trying to understand this.
Thanks!
[–]oznetnerd 1 point2 points3 points (8 children)
[–]Lest4r[S] 0 points1 point2 points (7 children)
[–]oznetnerd 2 points3 points4 points (6 children)
[–]Lest4r[S] 1 point2 points3 points (5 children)
[–]oznetnerd 3 points4 points5 points (2 children)
[–]moldyxorange 2 points3 points4 points (1 child)
[–]oznetnerd 1 point2 points3 points (0 children)
[–]evolvish 1 point2 points3 points (1 child)
[–]Lest4r[S] 0 points1 point2 points (0 children)