annotate intentmademanifest/web.py @ 18:4fd7fb12b782

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