def get(self): user = users.get_current_user() url = users.create_logout_url(self.request.uri) w = weatherDataForecast() w.getXML() currentTemp = int(round(w.getCurrentTemp())) wind = int(round(w.getWindSpeed())) suggEng = sugg.SuggestionEngine(user) suggestion = suggEng.newSuggestion(w) template_values = { 'url': url, 'currentTemp': currentTemp, 'wind': wind, 'suggestion': suggestion } path = os.path.abspath('templates/index.html') self.response.out.write(template.render(path, template_values))
def get(self): user = users.get_current_user() url = users.create_logout_url(self.request.uri) prefs = sm.getPrefs(user) w = weatherDataForecast(prefs.location) w.getXML() temp = int(round(w.getCurrentTemp())) maxtemp = int(round(w.getMaxTemp())) mintemp = int(round(w.getMinTemp())) wind = int(round(w.getWindSpeed())) humid = int(round(w.getHumidity())) rain = w.getHumidity() template_values = { 'temp': temp, 'maxTemp' : maxtemp, 'minTemp' : mintemp, 'wind' : wind, 'humid' : humid, 'rain' : rain, 'url': url, } path = os.path.join(os.path.dirname(__file__), 'templates/weather.html') self.response.out.write(template.render(path, template_values))