Commits

jaraco  committed bad9948

Customized the isapi-wsgi script for this site

  • Participants
  • Parent commits e9bb1d5

Comments (0)

Files changed (1)

File moin.isapi-wsgi.py

+# -*- coding: utf-8 -*-
+"""
+    MoinMoin - isapi-wsgi driver script
+
+    Put directions here.
+"""
+
+import sys
+import os
+
+appdir = os.path.dirname(__FILE__)
+
+# a) Configuration of Python's code search path
+#    If you already have set up the PYTHONPATH environment variable for the
+#    stuff you see below, you don't need to do a1) and a2).
+
+# a1) Path of the directory where the MoinMoin code package is located.
+#     Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
+#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
+
+# a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
+#     See wiki/config/... for some sample config files.
+sys.path.insert(0, os.path.join(appdir, config))
+#sys.path.insert(0, '/path/to/farmconfigdir')
+
+# b) Configuration of moin's logging
+#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
+#    You also don't need this if you are happy with the builtin defaults.
+#    See wiki/config/logging/... for some sample config files.
+#from MoinMoin import log
+#log.load_config('/path/to/logging_configuration_file')
+
+# Debug mode - show detailed error reports
+#os.environ['MOIN_DEBUG'] = '1'
+
+
+from MoinMoin.server.server_wsgi import moinmoinApp
+import isapi_wsgi
+import isapi
+
+def factory():
+	"The entry point for when the ISAPIDLL is triggered"
+	try:
+		return isapi_wsgi.ISAPISimpleHandler(moinmoinApp())
+	except:
+		print("Traceback occurred starting up the application")
+		traceback.print_exc()
+
+__ExtensionFactory__ = factory
+
+def handle_command_line():
+	"Install or remove the extension to the virtual directory"
+	import isapi.install
+	params = isapi.install.ISAPIParameters()
+	# Setup the virtual directories - this is a list of directories our
+	# extension uses - in this case only 1.
+	# Each extension has a "script map" - this is the mapping of ISAPI
+	# extensions.
+	sm = [
+		isapi.install.ScriptMapParams(Extension="*", Flags=0)
+	]
+	vd = isapi.install.VirtualDirParameters(
+		Server="Chai and Chaat Wiki",
+		Name="/",
+		Description = "MoinMoin Application",
+		ScriptMaps = sm,
+		ScriptMapUpdate = "end",
+		)
+	params.VirtualDirs = [vd]
+	isapi.install.HandleCommandLine(params)
+
+if __name__ == '__main__': handle_command_line()