annotate commitwatcher/web.py @ 20:a8e21cfda5fe

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