Exemplo n.º 1
0
 def get(self, lat, lon):
     '''Write out the JSON predictions for the user's nearest stops. Eventually we will loop through each data provider to give the user the closest stops.'''
     current_user = users.get_current_user()
     if current_user:
         user = models.User.all().filter('user =', current_user).get()
     else:
         user = default_user.user()
     self.response.out.write(json.dumps(functions.apiwrapperfor("actransit").get_nearest_predictions(lat, lon, user.max_arrivals, user.show_missed)))
Exemplo n.º 2
0
 def get(self):
     '''Render the settings page.'''
     current_user = users.get_current_user()
     if current_user:
         user = models.User.all().filter('user ='******'maxArrivals' : user.max_arrivals, 'showMissed' : "yes" if user.show_missed else "no", 'mapType' : user.map_type, 'showControls' : user.show_controls }))        
Exemplo n.º 3
0
 def get(self):
     '''Write out the JSON predictions for the user's stops.'''
     current_user = users.get_current_user()
     if current_user:
         user = models.User.all().filter('user ='******'position')
         else:
             return
     else:
         user = default_user.user()
         stops = default_user.stops()
     predictionList = []
     for index, stop in enumerate(stops):
         predictionList.append({ "id": stop.key().id() if stop.is_saved() else index, "directions": functions.apiwrapperfor(stop.agency_tag).get_directions(stop, user.max_arrivals, user.show_missed) })
     self.response.out.write(json.dumps(predictionList))
Exemplo n.º 4
0
 def get(self):
     current_user = users.get_current_user()
     if current_user:
         user = models.User.all().filter('user ='******'zoom' : user.zoom_level,
                     'lat' : user.latitude,
                     'lon' : user.longitude,
                     'mapType' : user.map_type,
                     'showControls' : user.show_controls,
                     'user_lat' : user_lat,
                     'user_lon' : user_lon,
                     }))