Example #1
0
def start():
    evwsgi.start("0.0.0.0", "8080")
    evwsgi.set_base_module(fapws.base)
    evwsgi.wsgi_cb(("",generic))
    evwsgi.set_debug(0)    
    print "libev ABI version:%i.%i" % evwsgi.libev_version()
    evwsgi.run()
Example #2
0
def start():
    evwsgi.start("0.0.0.0", "8080")
    evwsgi.set_base_module(fapws.base)
    evwsgi.wsgi_cb(("", generic))
    evwsgi.set_debug(0)
    print "libev ABI version:%i.%i" % evwsgi.libev_version()
    evwsgi.run()
Example #3
0
 def start(self):
     evwsgi.start(self.host, self.port)
     evwsgi.set_base_module(base)
     
     #def app(environ, start_response):
     #    environ['wsgi.multiprocess'] = False
     #    return wsgi_app(environ, start_response)
 
     evwsgi.wsgi_cb(('',self.app))
     #evwsgi.set_debug(1)#开启调试
     evwsgi.set_debug(0)        
     print "libev ABI version:%i.%i" % evwsgi.libev_version()
     evwsgi.run()
Example #4
0
File: run.py Project: wuzhe/nfapws
def start():
    evwsgi.start("0.0.0.0", 8085)

    evwsgi.set_base_module(fapws.base)

    # def generic(environ, start_response):
    #    return ["page not found"]

    def index(environ, start_response):
        print "GET:", environ["fapws.uri"]
        return views.index(environ, start_response)

    def display(environ, start_response):
        print "GET:", environ["fapws.uri"]
        return views.display(environ, start_response)

    def edit(environ, start_response):
        # print environ['fapws.params']
        print "GET:", environ["fapws.uri"]
        r = views.Edit()
        return r(environ, start_response)

    favicon = fapws.contrib.views.Staticfile("static/img/favicon.ico")

    def mystatic(environ, start_response):
        print "GET:", environ["fapws.uri"]
        s = fapws.contrib.views.Staticfile("static/")
        return s(environ, start_response)

    evwsgi.wsgi_cb(("/display/", display))
    evwsgi.wsgi_cb(("/edit", edit))
    evwsgi.wsgi_cb(("/new", edit))
    evwsgi.wsgi_cb(("/static/", mystatic))
    # evwsgi.wsgi_cb(('/favicon.ico',favicon)),

    evwsgi.wsgi_cb(("/", index))
    # evhttp.gen_http_cb(generic)
    evwsgi.set_debug(0)
    print "libev ABI version:%i.%i" % evwsgi.libev_version()
    evwsgi.run()
Example #5
0
def start():
    evwsgi.start("0.0.0.0", "8085")

    evwsgi.set_base_module(fapws.base)

    #def generic(environ, start_response):
    #    return ["page not found"]

    def index(environ, start_response):
        print "GET:", environ['fapws.uri']
        return views.index(environ, start_response)

    def display(environ, start_response):
        print "GET:", environ['fapws.uri']
        return views.display(environ, start_response)

    def edit(environ, start_response):
        #print environ['fapws.params']
        print "GET:", environ['fapws.uri']
        r = views.Edit()
        return r(environ, start_response)

    favicon = fapws.contrib.views.Staticfile("static/img/favicon.ico")

    def mystatic(environ, start_response):
        print "GET:", environ['fapws.uri']
        s = fapws.contrib.views.Staticfile("static/")
        return s(environ, start_response)

    evwsgi.wsgi_cb(("/display/", display))
    evwsgi.wsgi_cb(("/edit", edit))
    evwsgi.wsgi_cb(("/new", edit))
    evwsgi.wsgi_cb(("/static/", mystatic))
    #evwsgi.wsgi_cb(('/favicon.ico',favicon)),

    evwsgi.wsgi_cb(("/", index))
    #evhttp.gen_http_cb(generic)
    evwsgi.set_debug(0)
    print "libev ABI version:%i.%i" % evwsgi.libev_version()
    evwsgi.run()