当前位置: 首页>>代码示例>>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;未经允许,请勿转载。