Exemplo n.º 1
0
 def run(self, *middleware):
     """
     Starts handling requests. If called in a CGI or FastCGI context, it will follow
     that protocol. If called from the command line, it will start an HTTP
     server on the port named in the first command line argument, or, if there
     is no argument, on port 8080.
     
     `middleware` is a list of WSGI middleware which is applied to the resulting WSGI
     function.
     """
     return wsgi.runwsgi(self.wsgifunc(*middleware))
Exemplo n.º 2
0
    def run(self, *middleware):
        """
        Starts handling requests. If called in a CGI or FastCGI context, it will follow
        that protocol. If called from the command line, it will start an HTTP
        server on the port named in the first command line argument, or, if there
        is no argument, on port 8080.

        `middleware` is a list of WSGI middleware which is applied to the resulting WSGI
        function.
        """
        return wsgi.runwsgi(self.wsgifunc(*middleware))
Exemplo n.º 3
0
 def run(self, *middleware):
     """
     app.run()就是说这个web app应用程序启动了,开始整体对外提供服务了,可以访问url并处理得到response了.
     --------------------------------------------------------------------------------------------
     Starts handling requests. If called in a CGI or FastCGI context, it will follow
     that protocol. If called from the command line, it will start an HTTP
     server on the port named in the first command line argument, or, if there
     is no argument, on port 8080.
     
     `middleware` is a list of WSGI middleware which is applied to the resulting WSGI
     function.
     """
     # see wsgi.py line 30
     return wsgi.runwsgi(self.wsgifunc(*middleware))
Exemplo n.º 4
0
def run(inp, fvars, *middleware):
    """
    Starts handling requests. If called in a CGI or FastCGI context, it will follow
    that protocol. If called from the command line, it will start an HTTP
    server on the port named in the first command line argument, or, if there
    is no argument, on port 8080.

    `input` is a callable, then it's called with no arguments.
    Otherwise, it's a `mapping` object to be passed to `handle(...)`.

    **Caveat:** So that `reloader` will work correctly, input has to be a variable,
    it can't be a tuple passed in directly.

    `middleware` is a list of WSGI middleware which is applied to the resulting WSGI
    function.
    """
    autoreload = http.reloader in middleware
    return wsgi.runwsgi(webapi.wsgifunc(webpyfunc(inp, fvars, autoreload), *middleware))
Exemplo n.º 5
0
def run(inp, fvars, *middleware):
    """
    Starts handling requests. If called in a CGI or FastCGI context, it will follow
    that protocol. If called from the command line, it will start an HTTP
    server on the port named in the first command line argument, or, if there
    is no argument, on port 8080.

    `input` is a callable, then it's called with no arguments.
    Otherwise, it's a `mapping` object to be passed to `handle(...)`.

    **Caveat:** So that `reloader` will work correctly, input has to be a variable,
    it can't be a tuple passed in directly.

    `middleware` is a list of WSGI middleware which is applied to the resulting WSGI
    function.
    """
    autoreload = http.reloader in middleware
    return wsgi.runwsgi(
        webapi.wsgifunc(webpyfunc(inp, fvars, autoreload), *middleware))
Exemplo n.º 6
0
 def run(self, *middleware):
     return wsgi.runwsgi(self.wsgifunc(*middleware))