source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/handlers/isapiwsgihandler.py

main
Last change on this file was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 1.3 KB
Line 
1"""
2web2py handler for isapi-wsgi for IIS. Requires:
3http://code.google.com/p/isapi-wsgi/
4"""
5# The entry point for the ISAPI extension.
6
7
8def __ExtensionFactory__():
9    import os
10    import sys
11    path = os.path.dirname(os.path.abspath(__file__))
12    os.chdir(path)
13    if not os.path.isdir('applications'):
14        raise RuntimeError('Running from the wrong folder')
15    sys.path = [path] + [p for p in sys.path if not p == path]
16    import gluon.main
17    import isapi_wsgi
18    application = gluon.main.wsgibase
19    return isapi_wsgi.ISAPIThreadPoolHandler(application)
20
21# ISAPI installation:
22if __name__ == '__main__':
23    import sys
24    if len(sys.argv) < 2:
25        print "USAGE: python isapiwsgihandler.py install --server=Sitename"
26        sys.exit(0)
27    from isapi.install import ISAPIParameters
28    from isapi.install import ScriptMapParams
29    from isapi.install import VirtualDirParameters
30    from isapi.install import HandleCommandLine
31
32    params = ISAPIParameters()
33    sm = [ScriptMapParams(Extension="*", Flags=0)]
34    vd = VirtualDirParameters(Name="appname",
35                              Description="Web2py in Python",
36                              ScriptMaps=sm,
37                              ScriptMapUpdate="replace")
38    params.VirtualDirs = [vd]
39    HandleCommandLine(params)
Note: See TracBrowser for help on using the repository browser.