当前位置: 首页>>代码示例>>Python>>正文


Python waitress.serve方法代码示例

本文整理汇总了Python中waitress.serve方法的典型用法代码示例。如果您正苦于以下问题:Python waitress.serve方法的具体用法?Python waitress.serve怎么用?Python waitress.serve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在waitress的用法示例。


在下文中一共展示了waitress.serve方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: launchWebEvolutionaryInfo

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def launchWebEvolutionaryInfo():
    print("WEBSERVER MODE")
    webpageTitle = "japonicus evolutionary statistics - v%.2f" % VERSION
    webApp, webServer = promoterz.webServer.core.build_server(webpageTitle)

    webServerProcess = Thread(
        target=waitress.serve,
        kwargs={
            "app": webServer,
            "listen": "0.0.0.0:8182"
        }
    )

    webServerProcess.start()
    return webApp 
开发者ID:Gab0,项目名称:japonicus,代码行数:17,代码来源:japonicus.py

示例2: main

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def main():
    # waitress configuration
    kwargs = {}
    for option, value  in conf.items('waitress'):
        kwargs[option] = value
    waitress.serve(pywebdriver.app, **kwargs)

# Run application 
开发者ID:akretion,项目名称:pywebdriver,代码行数:10,代码来源:waitress_server.py

示例3: _callFUT

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def _callFUT(self, app, **kw):
        from waitress import serve
        return serve(app, **kw) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:5,代码来源:test_init.py

示例4: run

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def run(self):
        logger.debug('Call waitress.serve in %r ...', self)
        wsgi_app = WSGIApp()
        server = waitress.create_server(wsgi_app, unix_socket=self.usock)
        wsgi_app.server = server
        self.server = server
        self.server_ready_event.set()
        server.run() 
开发者ID:msabramo,项目名称:requests-unixsocket,代码行数:10,代码来源:testutils.py

示例5: run_server

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def run_server(info):
    app = info.load_app()
    Limiter(
        app,
        key_func=get_ipaddr,
        default_limits=config.config.rate_limit
    )
    if config.config.allow_cors:
        CORS(app)
    serve(app, host=config.config.host, port=config.config.port) 
开发者ID:ZerataX,项目名称:matrix-registration,代码行数:12,代码来源:app.py

示例6: server

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def server(reload=False):
    "Run the server"
    if reload:
        reload_module.reload_me("server")
    else:
        waitress.serve(app, host=app.config["HOST"], port=app.config["PORT"],
                threads=app.config["THREADS"]) 
开发者ID:puffinrocks,项目名称:puffin,代码行数:9,代码来源:puffin.py

示例7: run

# 需要导入模块: import waitress [as 别名]
# 或者: from waitress import serve [as 别名]
def run(argv=sys.argv, _serve=serve):
    """Command line runner."""
    name = os.path.basename(argv[0])

    try:
        kw, args = Adjustments.parse_args(argv[1:])
    except getopt.GetoptError as exc:
        show_help(sys.stderr, name, str(exc))
        return 1

    if kw['help']:
        show_help(sys.stdout, name)
        return 0

    if len(args) != 1:
        show_help(sys.stderr, name, 'Specify one application only')
        return 1

    try:
        module, obj_name = match(args[0])
    except ValueError as exc:
        show_help(sys.stderr, name, str(exc))
        return 1

    # Add the current directory onto sys.path
    sys.path.append(os.getcwd())

    # Get the WSGI function.
    try:
        app = resolve(module, obj_name)
    except ImportError:
        show_help(sys.stderr, name, "Bad module '{0}'".format(module))
        return 1
    except AttributeError:
        show_help(sys.stderr, name, "Bad object name '{0}'".format(obj_name))
        return 1
    if kw['call']:
        app = app()

    # These arguments are specific to the runner, not waitress itself.
    del kw['call'], kw['help']

    _serve(app, **kw)
    return 0 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:46,代码来源:runner.py


注:本文中的waitress.serve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。