view commitwatcher/web/app.py @ 37:798b747b65d6

foo
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 04 Nov 2013 22:25:45 -0800
parents f82331d875f0
children
line wrap: on
line source

#!/usr/bin/env python

"""
web handler for CommitWatcher
"""

import os
from webob import Request, Response, exc

here = os.path.dirname(os.path.abspath(__file__))

class MercurialFeedServer(object):
    """serves file + directory feeds for an hg repo"""

    def __init__(self, repository, **kw):
        self.repository = repository

    def __call__(self, environ, start_response):
        request = Request(environ)
        response = Response(content_type='text/plain',
                            body="CommitWatcher")
        return response(environ, start_response)


def main(args=sys.argv[1:]):
    """serve WSGI app"""
    from wsgiref import simple_server
    app = Handler()
    server = simple_server.make_server(host='0.0.0.0', port=8080, app=app)
    server.serve_forever()

if __name__ == '__main__':
    main()