#!/usr/bin/python

# Copyright (C) 1999 Milan Zamazal
#
# COPYRIGHT NOTICE
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.


"""FastCGI interface.
"""

__author__  = "Milan Zamazal <pdm@freesoft.cz>"
__version__ = "$Id: fcgiscript.py,v 1.2 1999/03/25 19:21:44 pdm Exp $"
__copyright__ = "GNU General Public License, version 2"


import os
import fcgi
from cgiscript import *


def fgo ():
    while fcgi.isFCGI ():
        req = fcgi.Accept ()
        os.environ = req.env
        form = req.getFieldStorage ()
        go (form)
        req.Finish ()


if __name__ == '__main__':
    fgo ()
