0
|
1 #!/usr/bin/env python
|
|
2
|
|
3 """
|
|
4 web handler for CommitWatcher
|
|
5 """
|
|
6
|
28
|
7 import os
|
0
|
8 from webob import Request, Response, exc
|
|
9
|
28
|
10 here = os.path.dirname(os.path.abspath(__file__))
|
|
11
|
|
12 class MercurialFeedServer(object):
|
|
13 """serves file + directory feeds for an hg repo"""
|
0
|
14
|
25
|
15 def __init__(self, repository, **kw):
|
|
16 self.repository = repository
|
0
|
17
|
|
18 def __call__(self, environ, start_response):
|
|
19 request = Request(environ)
|
|
20 response = Response(content_type='text/plain',
|
|
21 body="CommitWatcher")
|
|
22 return response(environ, start_response)
|
|
23
|
28
|
24
|
|
25 def main(args=sys.argv[1:]):
|
|
26 """serve WSGI app"""
|
0
|
27 from wsgiref import simple_server
|
|
28 app = Handler()
|
|
29 server = simple_server.make_server(host='0.0.0.0', port=8080, app=app)
|
|
30 server.serve_forever()
|
28
|
31
|
|
32 if __name__ == '__main__':
|
|
33 main()
|