Mercurial > kallithea
comparison hgapp.py @ 0:564e40829f80
initial commit.
author | Marcin Kuzminski |
---|---|
date | Thu, 18 Feb 2010 13:01:57 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:564e40829f80 |
---|---|
1 import logging | |
2 from logging import Formatter, StreamHandler | |
3 from wsgiref.simple_server import make_server | |
4 from mercurial.hgweb.hgwebdir_mod import hgwebdir | |
5 from mercurial.hgweb.request import wsgiapplication | |
6 | |
7 log = logging.getLogger(__name__) | |
8 log.setLevel(logging.DEBUG) | |
9 formatter = Formatter("%(asctime)s - %(levelname)s %(message)s") | |
10 console_handler = StreamHandler() | |
11 console_handler.setFormatter(formatter) | |
12 log.addHandler(console_handler) | |
13 | |
14 def make_web_app(): | |
15 | |
16 repos = "hgwebdir.config" | |
17 hgwebapp = hgwebdir(repos) | |
18 return hgwebapp | |
19 | |
20 port = 8000 | |
21 ip = '127.0.0.1' | |
22 | |
23 log.info('Starting server on %s:%s' % (ip, port)) | |
24 httpd = make_server(ip, port, wsgiapplication(make_web_app)) | |
25 httpd.serve_forever() | |
26 |