Exemplo n.º 1
0
 def __init__(self, user):
     self.user = user
     self.prefs = sm.getPrefs(user)
     self.weights = {"verylight": 1}
     self.weights["light"] = self.weights["verylight"]*self.prefs.vll
     self.weights["medium"] = self.weights["light"]*self.prefs.lm
     self.weights["heavy"] = self.weights["medium"]*self.prefs.mh
     self.weights["veryheavy"] = self.weights["heavy"]*self.prefs.hvh
Exemplo n.º 2
0
 def get(self):
     user = users.get_current_user()
     url = users.create_logout_url(self.request.uri)
     clothes = sm.getAllClothes(user)
     prefs = sm.getPrefs(user)
     template_values = {
         'prefs': prefs,
         'clothes': clothes,
         'url': url,
     }
     path = os.path.join(os.path.dirname(__file__), 'templates/prefs.html')
     self.response.out.write(template.render(path, template_values))
Exemplo n.º 3
0
 def post(self):
     user = users.get_current_user()
     prefs = sm.getPrefs(user)
     prefs.veryheavy_max = long(self.request.get('veryheavy_max'))
     prefs.veryheavy_min = long(self.request.get('veryheavy_min'))
     prefs.heavy_max = long(self.request.get('heavy_max'))
     prefs.heavy_min = long(self.request.get('heavy_max'))
     prefs.medium_max = long(self.request.get('medium_max'))
     prefs.medium_min = long(self.request.get('medium_max'))
     prefs.light_max = long(self.request.get('light_max'))
     prefs.light_min = long(self.request.get('light_max'))
     prefs.verylight_max = long(self.request.get('verylight_max'))
     prefs.verylight_min = long(self.request.get('verylight_max'))
     prefs.location = self.request.get('location')
     prefs.put()
     self.redirect('/')
Exemplo n.º 4
0
 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))