# HG changeset patch # User paulb # Date 1137174169 0 # Node ID ce3f6df4252fa9feb5c6d511ba1719fe24d3add1 # Parent 891bc59144326d564ec879d3bcd8c3797b94ccc3 [project @ 2006-01-13 17:42:49 by paulb] Changed the mod_python configuration script to deploy resources without requiring an annoying "filename" suffix. diff -r 891bc5914432 -r ce3f6df4252f tools/Apache/config.py --- a/tools/Apache/config.py Fri Jan 13 17:42:13 2006 +0000 +++ b/tools/Apache/config.py Fri Jan 13 17:42:49 2006 +0000 @@ -46,13 +46,12 @@ """ mod_python_template = """ -Alias %s "%s" - - - AddHandler python-program %s + + SetHandler python-program PythonHandler %s PythonDebug On - + PythonPath "['%s'] + sys.path" + """ if __name__ == "__main__": @@ -62,14 +61,12 @@ apache_site_dir = sys.argv[3] site_name = sys.argv[4] url_path = sys.argv[5] - if app_type == "mod_python": - suffix = sys.argv[6] - elif app_type != "CGI": + if app_type not in ("mod_python", "CGI"): print "Please specify either CGI or mod_python as the application type." sys.exit(1) except IndexError: - print "config.py CGI|mod_python []" + print "config.py CGI|mod_python " print print "CGI configures a CGI application" print "mod_python configures a mod_python application" @@ -85,11 +82,6 @@ print print " is the path at which your application will be published" print "eg. /cgi/simple" - print - print "mod_python options:" - print - print " is the ending which published resources in the application should have" - print "eg. .simple" sys.exit(1) # Derived information. @@ -112,7 +104,7 @@ sessions_dir = os.path.join(handler_dir, "WebStack-sessions") elif app_type == "mod_python": - template = mod_python_template % (url_path, handler_dir, handler_dir, suffix, handler_name) + template = mod_python_template % (url_path, handler_name, handler_dir) server_root = apache_server.get_server_root_from_config() or apache_site_dir sessions_dir = os.path.join(server_root, "WebStack-sessions")