Start the CherryPy app server in 'serverless' mode (for modpython/WSGI).
(req=None)
| 308 | # modpython and other WSGI # |
| 309 | |
| 310 | def startup_modpython(req=None): |
| 311 | """Start the CherryPy app server in 'serverless' mode (for modpython/WSGI). |
| 312 | """ |
| 313 | if cherrypy.engine.state == cherrypy._cpengine.STOPPED: |
| 314 | if req: |
| 315 | if 'nullreq' in req.get_options(): |
| 316 | cherrypy.engine.request_class = NullRequest |
| 317 | cherrypy.engine.response_class = NullResponse |
| 318 | ab_opt = req.get_options().get('ab', '') |
| 319 | if ab_opt: |
| 320 | global AB_PATH |
| 321 | AB_PATH = ab_opt |
| 322 | cherrypy.engine.start() |
| 323 | if cherrypy.engine.state == cherrypy._cpengine.STARTING: |
| 324 | cherrypy.engine.wait() |
| 325 | return 0 # apache.OK |
| 326 | |
| 327 | |
| 328 | def run_modpython(use_wsgi=False): |