franta-hg@1: #!/usr/bin/env python franta-hg@1: # franta-hg@1: # An example CGI script to use hgweb, edit as necessary franta-hg@1: franta-hg@1: # adjust python path if not a system-wide install: franta-hg@1: #import sys franta-hg@1: #sys.path.insert(0, "/path/to/python/lib") franta-hg@1: franta-hg@1: # enable importing on demand to reduce startup time franta-hg@1: from mercurial import demandimport; demandimport.enable() franta-hg@1: franta-hg@1: # Uncomment to send python tracebacks to the browser if an error occurs: franta-hg@1: import cgitb franta-hg@1: cgitb.enable() franta-hg@1: franta-hg@1: # If you'd like to serve pages with UTF-8 instead of your default franta-hg@1: # locale charset, you can do so by uncommenting the following lines. franta-hg@1: # Note that this will cause your .hgrc files to be interpreted in franta-hg@1: # UTF-8 and all your repo files to be displayed using UTF-8. franta-hg@1: # franta-hg@1: import os franta-hg@1: os.environ["HGENCODING"] = "UTF-8" franta-hg@1: franta-hg@1: from mercurial.hgweb.hgweb_mod import hgweb franta-hg@1: import mercurial.hgweb.wsgicgi as wsgicgi franta-hg@1: franta-hg@1: application = hgweb("/var/hg/projekty/pokus", "Pokus") franta-hg@1: wsgicgi.launch(application)