當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。