PageRenderTime 87ms CodeModel.GetById 81ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/google_app/metrichandler.py

https://code.google.com/p/dwarftherapist/
Python | 17 lines | 13 code | 4 blank | 0 comment | 0 complexity | 907724c6cc567aae17a76178ea1f5e73 MD5 | raw file
 1from google.appengine.ext import webapp
 2import pprint
 3import logging
 4
 5class MetricHandler(webapp.RequestHandler):
 6    def get(self, *args):
 7        self.response.headers['Content-Type'] = 'text/html'
 8        info = ip_info("96.253.131.222")
 9        self.response.out.write("Metrics must be posted! %s<br/>%s" % (pprint.pformat(info), self.request.arguments()))
10        
11    def post(self, *args):
12        self.response.headers['Content-Type'] = 'text/html'
13        self.response.out.write("POST<br/>%s" % "<br/>".join(args))
14        logging.info("UPDATE FROM IP %s USING VERSION %s", 
15                     self.request.remote_addr, 3)
16
17