Example #1
0
 def get(self):
     ws = get_watchers()
     zips = {}
     for w in ws:
         zips[str(w.zip)] = ""
     for zip in zips:
         zips[zip] = zipcode_fetch(zip)
     for_template = []
     for zip in zips:
         forecast = zips[zip]
         for_template.append({ 'zip' : zip, 'forecast' : forecast, 
                               'is_rain' : is_rain(forecast) })
     # now find all the emails we would send to
     email_outs = []
     for w in ws:
         if (is_rain(zips[str(w.zip)])):
             email_outs.append(w.email)
     vals = { 'zips' : for_template, 'email_outs' : email_outs }
     path = os.path.join(os.path.dirname(__file__), 'sweep.html')
     self.response.out.write(template.render(path, vals))
Example #2
0
 def get(self):
     vals = { 'watchers' : get_watchers(), 'helena_weather' : zipcode_fetch('59601') }
     path = os.path.join(os.path.dirname(__file__), 'admin.html')
     self.response.out.write(template.render(path, vals))