handlers.py
changeset 80 a0662cff1d9d
parent 79 43ac75054d5c
child 82 afd3120ec71e
equal deleted inserted replaced
79:43ac75054d5c 80:a0662cff1d9d
   101     elif type == 'png' :
   101     elif type == 'png' :
   102         # PNG image
   102         # PNG image
   103         png_data = formatter.format_png(lines)
   103         png_data = formatter.format_png(lines)
   104 
   104 
   105         return http.Response(png_data, 'image/png', charset=None)
   105         return http.Response(png_data, 'image/png', charset=None)
       
   106     
       
   107     elif type == 'rss' :
       
   108         # RSS feed
       
   109         rss_data = formatter.format_rss(lines)
       
   110 
       
   111         return http.Response(rss_data, 'application/rss+xml')
   106 
   112 
   107     else :
   113     else :
   108         raise http.ResponseError("Unrecognized type: %r" % (type, ))
   114         raise http.ResponseError("Unrecognized type: %r" % (type, ))
   109 
   115 
   110 @preferences.handler(prefs.formatter, prefs.timezone, prefs.count)
   116 @preferences.handler(prefs.formatter, prefs.timezone, prefs.count)