def runwsgi(func):
 if os.environ.has_key('SERVER_SOFTWARE'):
  os.environ['FCGI_FORCE_CGI'] = 'Y'
 if (os.environ.has_key('PHP_FCGI_CHILDREN') or os.environ.has_key('SERVER_SOFTWARE')):
  import flup.server.fcgi
  return runfcgi(func)
 if ('scgi' in sys.argv):
  import flup.server.scgi
  return runscgi(func)
 return runsimple(func, listget(sys.argv, 1, 8080))

def runwsgi ( func ) : if os . environ . has_key ( 'SERVER_SOFTWARE' ) : os . environ [ 'FCGI_FORCE_CGI' ] = 'Y' if ( os . environ . has_key ( 'PHP_FCGI_CHILDREN' ) or os . environ . has_key ( 'SERVER_SOFTWARE' ) ) : import flup . server . fcgi return runfcgi ( func ) if ( 'scgi' in sys . argv ) : import flup . server . scgi return runscgi ( func ) return runsimple ( func , listget ( sys . argv , 1 , 8080 ) )
runs a wsgi-compatible function using fcgi .