annotate schema/web.py @ 1:5baa23a8d32f default tip

more stuff
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 17 Feb 2012 12:59:09 -0800
parents f7edadebb1de
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 web handler for schema
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 from webob import Request, Response, exc
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 class Handler(object):
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 def __init__(self, **kw):
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 pass
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 def __call__(self, environ, start_response):
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 request = Request(environ)
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 response = Response(content_type='text/plain',
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 body="schema")
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 return response(environ, start_response)
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 if __name__ == '__main__':
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 from wsgiref import simple_server
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 app = Handler()
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 server = simple_server.make_server(host='0.0.0.0', port=8080, app=app)
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 server.serve_forever()
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25
f7edadebb1de initial commit
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26