本文整理匯總了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()