本文整理汇总了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()
示例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()
示例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()
示例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 库源码的组织结构.
#
###############################################################################
示例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()