def runscgi(func):
 from flup.server.scgi import WSGIServer
 my_server = makeserver(WSGIServer)
 if (len(sys.argv) > 2):
  args = sys.argv[:]
  args.remove('scgi')
  hostport = args[1]
  hostport = hostport.split(':', 1)
  if (len(hostport) == 2):
   hostport = (hostport[0], int(hostport[1]))
  else:
   hostport = ('localhost', int(hostport[0]))
 else:
  hostport = ('localhost', 4000)
 return my_server(func, bindAddress=hostport).run()

def runscgi ( func ) : from flup . server . scgi import WSGIServer my_server = makeserver ( WSGIServer ) if ( len ( sys . argv ) > 2 ) : args = sys . argv [ : ] args . remove ( 'scgi' ) hostport = args [ 1 ] hostport = hostport . split ( ':' , 1 ) if ( len ( hostport ) == 2 ) : hostport = ( hostport [ 0 ] , int ( hostport [ 1 ] ) ) else : hostport = ( 'localhost' , int ( hostport [ 0 ] ) ) else : hostport = ( 'localhost' , 4000 ) return my_server ( func , bindAddress = hostport ) . run ( )
runs a wsgi-function with an scgi server .