def urlparser_hook(environ): if not environ.has_key('commentary.base_href'): environ['commentary.base_href'] = environ.get('SCRIPT_NAME', '') or '/'