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