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


Python _evwsgi.set_base_module方法代码示例

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


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

示例1: run

# 需要导入模块: from fapws import _evwsgi [as 别名]
# 或者: from fapws._evwsgi import set_base_module [as 别名]
def run(self, handler): # pragma: no cover
        import fapws._evwsgi as evwsgi
        from fapws import base, config
        port = self.port
        if float(config.SERVER_IDENT[-2:]) > 0.4:
            # fapws3 silently changed its API in 0.5
            port = str(port)
        evwsgi.start(self.host, port)
        # fapws3 never releases the GIL. Complain upstream. I tried. No luck.
        if 'BOTTLE_CHILD' in os.environ and not self.quiet:
            _stderr("WARNING: Auto-reloading does not work with Fapws3.\n")
            _stderr("         (Fapws3 breaks python thread support)\n")
        evwsgi.set_base_module(base)
        def app(environ, start_response):
            environ['wsgi.multiprocess'] = False
            return handler(environ, start_response)
        evwsgi.wsgi_cb(('', app))
        evwsgi.run() 
开发者ID:Autodesk,项目名称:arnold-usd,代码行数:20,代码来源:__init__.py

示例2: run

# 需要导入模块: from fapws import _evwsgi [as 别名]
# 或者: from fapws._evwsgi import set_base_module [as 别名]
def run(self, handler): # pragma: no cover
        import fapws._evwsgi as evwsgi
        from fapws import base, config
        port = self.port
        if float(config.SERVER_IDENT[-2:]) > 0.4:
            # fapws3 silently changed its API in 0.5
            port = str(port)
        evwsgi.start(self.host, port)
        # fapws3 never releases the GIL. Complain upstream. I tried. No luck.
        if 'BOTTLE_CHILD' in os.environ and not self.quiet:
            print "WARNING: Auto-reloading does not work with Fapws3."
            print "         (Fapws3 breaks python thread support)"
        evwsgi.set_base_module(base)
        def app(environ, start_response):
            environ['wsgi.multiprocess'] = False
            return handler(environ, start_response)
        evwsgi.wsgi_cb(('', app))
        evwsgi.run() 
开发者ID:zhangzhengde0225,项目名称:VaspCZ,代码行数:20,代码来源:bottle.py

示例3: run

# 需要导入模块: from fapws import _evwsgi [as 别名]
# 或者: from fapws._evwsgi import set_base_module [as 别名]
def run(self, handler):  # pragma: no cover
        import fapws._evwsgi as evwsgi
        from fapws import base, config
        port = self.port
        if float(config.SERVER_IDENT[-2:]) > 0.4:
            # fapws3 silently changed its API in 0.5
            port = str(port)
        evwsgi.start(self.host, port)
        # fapws3 never releases the GIL. Complain upstream. I tried. No luck.
        if 'BOTTLE_CHILD' in os.environ and not self.quiet:
            _stderr("WARNING: Auto-reloading does not work with Fapws3.\n")
            _stderr("         (Fapws3 breaks python thread support)\n")
        evwsgi.set_base_module(base)

        def app(environ, start_response):
            environ['wsgi.multiprocess'] = False
            return handler(environ, start_response)

        evwsgi.wsgi_cb(('', app))
        evwsgi.run() 
开发者ID:brycesub,项目名称:silvia-pi,代码行数:22,代码来源:bottle.py

示例4: run

# 需要导入模块: from fapws import _evwsgi [as 别名]
# 或者: from fapws._evwsgi import set_base_module [as 别名]
def run(self, handler):  # 重写 run() 函数.
        import fapws._evwsgi as evwsgi
        from fapws import base
        import sys

        evwsgi.start(self.host, self.port)
        evwsgi.set_base_module(base)

        def app(environ, start_response):  # 函数嵌套定义,特别注意.
            environ['wsgi.multiprocess'] = False
            return handler(environ, start_response)

        evwsgi.wsgi_cb(('', app))  # 调用内嵌的 app()函数
        evwsgi.run()







###############################################################################
#                        框架全局入口
###############################################################################
# 功能: 全局入口
#
# 参数:
#    - server: web服务器
#    - host: 访问IP
#    - port: 端口号
#    - optinmize: 性能优化开关(该单词拼写有误)
#    - kargs: 扩展参数
#
# 关键代码:
#       - server.run(WSGIHandler)    # 启动web服务
# 备注:
#     1. 注意run()函数默认参数选项.
#     2. server.run() 根据不同的 web Server ,进行选择.
#     3. 理解 bottle 库源码的组织结构.
#
############################################################################### 
开发者ID:hhstore,项目名称:annotated-py-bottle,代码行数:43,代码来源:bottle.py

示例5: run

# 需要导入模块: from fapws import _evwsgi [as 别名]
# 或者: from fapws._evwsgi import set_base_module [as 别名]
def run(self, handler): # pragma: no cover
        import fapws._evwsgi as evwsgi
        from fapws import base
        evwsgi.start(self.host, self.port)
        evwsgi.set_base_module(base)
        def app(environ, start_response):
            environ['wsgi.multiprocess'] = False
            return handler(environ, start_response)
        evwsgi.wsgi_cb(('',app))
        evwsgi.run() 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:12,代码来源:bottle2.py


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