author | František Kučera <franta-hg@frantovo.cz> |
Mon Feb 16 21:21:34 2009 +0100 (2009-02-16) | |
changeset 4 | 5881614cdaef |
parent 3 | 40312bcd7cd2 |
permissions | -rw-r--r-- |
franta-hg@2 | 1 |
#!/usr/bin/env python |
franta-hg@2 | 2 |
# |
franta-hg@2 | 3 |
# An example CGI script to use hgweb, edit as necessary |
franta-hg@2 | 4 |
|
franta-hg@2 | 5 |
# adjust python path if not a system-wide install: |
franta-hg@2 | 6 |
#import sys |
franta-hg@2 | 7 |
#sys.path.insert(0, "/path/to/python/lib") |
franta-hg@2 | 8 |
|
franta-hg@2 | 9 |
# enable importing on demand to reduce startup time |
franta-hg@2 | 10 |
from mercurial import demandimport; demandimport.enable() |
franta-hg@2 | 11 |
|
franta-hg@2 | 12 |
# Uncomment to send python tracebacks to the browser if an error occurs: |
franta-hg@4 | 13 |
#import cgitb |
franta-hg@4 | 14 |
#cgitb.enable() |
franta-hg@2 | 15 |
|
franta-hg@2 | 16 |
# If you'd like to serve pages with UTF-8 instead of your default |
franta-hg@2 | 17 |
# locale charset, you can do so by uncommenting the following lines. |
franta-hg@2 | 18 |
# Note that this will cause your .hgrc files to be interpreted in |
franta-hg@2 | 19 |
# UTF-8 and all your repo files to be displayed using UTF-8. |
franta-hg@2 | 20 |
# |
franta-hg@2 | 21 |
import os |
franta-hg@2 | 22 |
os.environ["HGENCODING"] = "UTF-8" |
franta-hg@2 | 23 |
|
franta-hg@3 | 24 |
from mercurial.hgweb.hgwebdir_mod import hgwebdir |
franta-hg@2 | 25 |
import mercurial.hgweb.wsgicgi as wsgicgi |
franta-hg@2 | 26 |
|
franta-hg@3 | 27 |
application = hgwebdir("/var/hg/projekty.config") |
franta-hg@2 | 28 |
wsgicgi.launch(application) |