Attachment 'moinmoinloader19.py'
Download 1 ## moinmoinloader19.py
2 ##
3 ## entry point between the ISAPI extension
4 ## and the MoinMoin WSGI server
5 ## using ISAPI WSGI
6 ##
7 ## MoinMoin:DimitriJanczak / 18.11.2009 / 1.0 - Initial release
8 ## MoinMoin:DimitriJanczak / 15.12.2009 / 1.1 - adapted for MoinMoin 1.9
9 ## MoinMoin:DimitriJanczak / 05.04.2010 / 1.2 - automated virtual dirs parameters by importing farmconfig
10 ## portions from the examples installed with ISAPI WSGI
11
12 ## Import MoinMoin WSGI Server
13
14 ## MoinMoin 1.6 to 1.8
15 ## from MoinMoin.server.server_wsgi import moinmoinApp, WsgiConfig
16 ## MoinMoin 1.9
17 from MoinMoin.web.serving import make_application
18
19 ## no longer needed in 1.9
20 ##class Config(WsgiConfig):
21 ## pass
22 ## config = Config()
23
24 ## import the ISAPI WSGI glue
25 import isapi_wsgi
26
27 # The entry points for the ISAPI extension.
28 def __ExtensionFactory__():
29 ## new way to instantiate in 1.9
30 moinmoinApp = make_application(shared=True)
31 return isapi_wsgi.ISAPIThreadPoolHandler(moinmoinApp)
32
33
34 ## Installation code
35 if __name__=='__main__':
36 from isapi.install import *
37
38 # If run from the command-line, install ourselves.
39 params = ISAPIParameters()
40
41 sm = [
42 ScriptMapParams(Extension="*", Flags=0)
43 ]
44
45 # get the wikis list
46 try:
47 from farmconfig import wikis
48 except ImportError:
49 print "Update the PYTHONPATH variable with the directory where your farmconfig.py resides"
50 print "or add the following code to this file if you do not want system-wide inclusion:"
51 print "import sys"
52 print "sys.path.append(r'C:\Path\ToFarmConfig')"
53 raise
54
55 # Create a Virtual Directory per wiki
56 params.VirtualDirs = [ VirtualDirParameters(Name=wikiName,
57 Description = "ISAPI-WSGI gateway for %(wikiName)s " % { 'wikiName':wikiName } ,
58 ScriptMaps = sm,
59 ScriptMapUpdate = "replace" )
60 for (wikiName,_) in wikis ]
61
62 HandleCommandLine(params)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.