← Back
Editing: scgi.cpython-311.pyc
� #H\a � �� � d Z dZdZddlZddlZddlmZmZmZ ddl m Z dgZ G d� dee � � Ze d k r?d � ZddlmZ ej e� � Z eeej �� � � � � dS dS ) a� scgi - an SCGI/WSGI gateway. For more information about SCGI and mod_scgi for Apache1/Apache2, see <http://www.mems-exchange.org/software/scgi/>. For more information about the Web Server Gateway Interface, see <http://www.python.org/peps/pep-0333.html>. Example usage: #!/usr/bin/env python import sys from myapplication import app # Assume app is your WSGI application object from scgi import WSGIServer ret = WSGIServer(app).run() sys.exit(ret and 42 or 0) See the documentation for WSGIServer for more information. About the bit of logic at the end: Upon receiving SIGHUP, the python script will exit with status code 42. This can be used by a wrapper script to determine if the python script should be re-run. When a SIGINT or SIGTERM is received, the script exits with status code 0, possibly indicating a normal exit. Example wrapper script: #!/bin/sh STATUS=42 while test $STATUS -eq 42; do python "$@" that_script_above.py STATUS=$? done zAllan Saddi <allan@saddi.com>z $Revision$� N)�BaseSCGIServer� Connection� NoDefault)�ThreadedServer� WSGIServerc �<