Mercurial > hg > numerics
comparison kplot/web.py @ 0:48d0f28311a3
init
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 14 Aug 2014 16:26:16 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:48d0f28311a3 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 """ | |
4 web handler for kplot | |
5 """ | |
6 | |
7 from webob import Request, Response, exc | |
8 | |
9 class Handler(object): | |
10 | |
11 def __init__(self, **kw): | |
12 pass | |
13 | |
14 def __call__(self, environ, start_response): | |
15 request = Request(environ) | |
16 response = Response(content_type='text/plain', | |
17 body="kplot") | |
18 return response(environ, start_response) | |
19 | |
20 if __name__ == '__main__': | |
21 from wsgiref import simple_server | |
22 app = Handler() | |
23 server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) | |
24 server.serve_forever() | |
25 | |
26 |