michael@600: #!@l_prefix@/bin/python michael@600: michael@600: import os michael@600: import sys michael@600: sys.path.insert(0, "@l_prefix@/lib/mercurial") michael@600: michael@600: from mercurial import demandimport michael@600: demandimport.enable() michael@600: michael@600: from mercurial.hgweb import hgweb, wsgicgi michael@600: if os.getenv('HGWEB_REPO_PATH', '') != '' and os.getenv('HGWEB_REPO_NAME', '') != '': michael@600: application = hgweb(os.getenv('HGWEB_REPO_PATH'), os.getenv('HGWEB_REPO_NAME')) michael@600: else: michael@600: application = hgweb('@l_prefix@/etc/mercurial/hgweb.cfg') michael@600: wsgicgi.launch(application) michael@600: