def RedirectToRemoteHelp(path):
 allowed_chars = set(((string.ascii_letters + string.digits) + '._'))
 if (not (set(path) <= allowed_chars)):
  raise RuntimeError(('Unusual chars in path %r - possible exploit attempt.' % path))
 target_path = os.path.join(config_lib.CONFIG['AdminUI.github_docs_location'], path.replace('.html', '.adoc'))
 response = http.HttpResponse()
 response.write(("\n<script>\nvar friendly_hash = window.location.hash.replace('#_', '#').replace(/_/g, '-');\nwindow.location = '%s' + friendly_hash;\n</script>\n" % target_path))
 return response

def RedirectToRemoteHelp ( path ) : allowed_chars = set ( ( ( string . ascii_letters + string . digits ) + '._' ) ) if ( not ( set ( path ) <= allowed_chars ) ) : raise RuntimeError ( ( 'Unusual chars in path %r - possible exploit attempt.' % path ) ) target_path = os . path . join ( config_lib . CONFIG [ 'AdminUI.github_docs_location' ] , path . replace ( '.html' , '.adoc' ) ) response = http . HttpResponse ( ) response . write ( ( "\n<script>\nvar friendly_hash = window.location.hash.replace('#_', '#').replace(/_/g, '-');\nwindow.location = '%s' + friendly_hash;\n</script>\n" % target_path ) ) return response
redirect to github-hosted documentation .