#!@l_prefix@/bin/python

import os
import sys
sys.path.insert(0, "@l_prefix@/lib/mercurial")

from mercurial import demandimport
demandimport.enable()

from mercurial.hgweb import hgweb, wsgicgi
if os.getenv('HGWEB_REPO_PATH', '') != '' and os.getenv('HGWEB_REPO_NAME', '') != '':
     application = hgweb(os.getenv('HGWEB_REPO_PATH'), os.getenv('HGWEB_REPO_NAME'))
else:
     application = hgweb('@l_prefix@/etc/mercurial/hgweb.cfg')
wsgicgi.launch(application)

