本文整理汇总了Python中BaseHTTPServer.HTTPServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPServer.__init__方法的具体用法?Python HTTPServer.__init__怎么用?Python HTTPServer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseHTTPServer.HTTPServer
的用法示例。
在下文中一共展示了HTTPServer.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from BaseHTTPServer import HTTPServer [as 别名]
# 或者: from BaseHTTPServer.HTTPServer import __init__ [as 别名]
def __init__(
self,
host,
port,
app,
processes=40,
handler=None,
passthrough_errors=False,
ssl_context=None,
fd=None,
):
if not can_fork:
raise ValueError("Your platform does not support forking.")
BaseWSGIServer.__init__(
self, host, port, app, handler, passthrough_errors, ssl_context, fd
)
self.max_children = processes
示例2: __init__
# 需要导入模块: from BaseHTTPServer import HTTPServer [as 别名]
# 或者: from BaseHTTPServer.HTTPServer import __init__ [as 别名]
def __init__(self,parent=None):
ULObject.__init__(self,parent)
self.createAttribute("angle",float)
self.createAttribute("direction",int)
self.createAttribute("function",int)
self.createAttribute("length",int)
self.createAttribute("name",str)
self.createAttribute("net",str)
self.createAttribute("route",int)
self.createAttribute("swaplevel",int)
self.createAttribute("visible",int)
self.createAttribute("x",int)
self.createAttribute("y",int)
self.createAttribute("circles",[ULCircle])
self.createAttribute("contacts",[ULContact])
self.createAttribute("texts",[ULText])
self.createAttribute("wires",[ULWire])
示例3: __init__
# 需要导入模块: from BaseHTTPServer import HTTPServer [as 别名]
# 或者: from BaseHTTPServer.HTTPServer import __init__ [as 别名]
def __init__(self, server_address, RequestHandlerClass,
ssl_context=None, request_queue_size=None):
# This overrides the implementation of __init__ in python's
# SocketServer.TCPServer (which BaseHTTPServer.HTTPServer
# does not override, thankfully).
HTTPServer.__init__(self, server_address, RequestHandlerClass)
self.socket = socket.socket(self.address_family,
self.socket_type)
self.ssl_context = ssl_context
if ssl_context:
class TSafeConnection(tsafe.Connection):
def settimeout(self, *args):
self._lock.acquire()
try:
return self._ssl_conn.settimeout(*args)
finally:
self._lock.release()
self.socket = TSafeConnection(ssl_context, self.socket)
self.server_bind()
if request_queue_size:
self.socket.listen(request_queue_size)
self.server_activate()
示例4: __init__
# 需要导入模块: from BaseHTTPServer import HTTPServer [as 别名]
# 或者: from BaseHTTPServer.HTTPServer import __init__ [as 别名]
def __init__(self, protocol):
self._protocol = protocol
self._certfile = None
self._keyfile = None
self._password = None