當前位置: 首頁>>代碼示例>>Python>>正文


Python support.verbose方法代碼示例

本文整理匯總了Python中future.backports.test.support.verbose方法的典型用法代碼示例。如果您正苦於以下問題:Python support.verbose方法的具體用法?Python support.verbose怎麽用?Python support.verbose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在future.backports.test.support的用法示例。


在下文中一共展示了support.verbose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: make_https_server

# 需要導入模塊: from future.backports.test import support [as 別名]
# 或者: from future.backports.test.support import verbose [as 別名]
def make_https_server(case, certfile=CERTFILE, host=HOST, handler_class=None):
    # we assume the certfile contains both private key and certificate
    context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
    context.load_cert_chain(certfile)
    server = HTTPSServerThread(context, host, handler_class)
    flag = threading.Event()
    server.start(flag)
    flag.wait()
    def cleanup():
        if support.verbose:
            sys.stdout.write('stopping HTTPS server\n')
        server.stop()
        if support.verbose:
            sys.stdout.write('joining HTTPS thread\n')
        server.join()
    case.addCleanup(cleanup)
    return server 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:19,代碼來源:ssl_servers.py

示例2: get_request

# 需要導入模塊: from future.backports.test import support [as 別名]
# 或者: from future.backports.test.support import verbose [as 別名]
def get_request(self):
        # override this to wrap socket with SSL
        try:
            sock, addr = self.socket.accept()
            sslconn = self.context.wrap_socket(sock, server_side=True)
        except socket.error as e:
            # socket errors are silenced by the caller, print them here
            if support.verbose:
                sys.stderr.write("Got an error:\n%s\n" % e)
            raise
        return sslconn, addr 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:13,代碼來源:ssl_servers.py

示例3: log_message

# 需要導入模塊: from future.backports.test import support [as 別名]
# 或者: from future.backports.test.support import verbose [as 別名]
def log_message(self, format, *args):
        # we override this to suppress logging unless "verbose"
        if support.verbose:
            sys.stdout.write(" server (%s:%d %s):\n   [%s] %s\n" %
                             (self.server.server_address,
                              self.server.server_port,
                              self.request.cipher(),
                              self.log_date_time_string(),
                              format%args)) 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:11,代碼來源:ssl_servers.py

示例4: log_request

# 需要導入模塊: from future.backports.test import support [as 別名]
# 或者: from future.backports.test.support import verbose [as 別名]
def log_request(self, format, *args):
        if support.verbose:
            BaseHTTPRequestHandler.log_request(self, format, *args) 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:5,代碼來源:ssl_servers.py


注:本文中的future.backports.test.support.verbose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。