- self.current_departures = [x['ftime'] for x in
- self.itip.get_departures(url)]
- print self.current_departures
+ self.current_departures = map(self.map_departure, \
+ self.itip.get_departures(url))
+ #print self.current_departures
+ self.departuresLoaded.emit()
+
+ threading.Thread(target=load_async).start()
+
+ @Slot(str)
+ def load_station_departures(self, station):
+ def load_async():
+ self.current_departures = map(self.map_departure, \
+ sort_departures(self.itip.get_departures_by_station(station)))
+ #print self.current_departures
+ self.departuresLoaded.emit()
+
+ threading.Thread(target=load_async).start()
+
+ @Slot(float, float)
+ def load_nearby_departures(self, lat, lon):
+ def load_async():
+ self.current_departures = []
+ try:
+ stations = get_nearby_stations(lat, lon)
+ print stations
+ for station in stations:
+ print station
+ try:
+ self.current_departures += self.itip.get_departures_by_station(station)
+ except Exception as e:
+ print e.message
+ self.current_departures = map(self.map_departure, \
+ sort_departures(self.current_departures))
+ #print self.current_departures
+ except Exception as e:
+ print e.message
+
+ print 'loaded'