本文整理汇总了Python中http.server.SimpleHTTPRequestHandler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleHTTPRequestHandler.__init__方法的具体用法?Python SimpleHTTPRequestHandler.__init__怎么用?Python SimpleHTTPRequestHandler.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http.server.SimpleHTTPRequestHandler
的用法示例。
在下文中一共展示了SimpleHTTPRequestHandler.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
self._logger = get_ws_logger(self)
self.origin = server.origin
self.port = server.port
self.permissive = server.permissive
SimpleHTTPRequestHandler.__init__(self, request,
client_address, server)
示例2: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, addr, only_upgrade=False, file_only=False,
no_parent=False):
self.only_upgrade = only_upgrade # only allow upgrades
self.webroot = os.path.realpath(".")
self.file_only = file_only
self.no_parent = no_parent
SimpleHTTPRequestHandler.__init__(self, req, addr, object())
示例3: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, addr, server):
# Retrieve a few configuration variables from the server
self.only_upgrade = getattr(server, "only_upgrade", False)
self.verbose = getattr(server, "verbose", False)
self.daemon = getattr(server, "daemon", False)
self.record = getattr(server, "record", False)
self.run_once = getattr(server, "run_once", False)
self.rec = None
self.handler_id = getattr(server, "handler_id", False)
self.file_only = getattr(server, "file_only", False)
self.traffic = getattr(server, "traffic", False)
self.logger = getattr(server, "logger", None)
if self.logger is None:
self.logger = WebSocketServer.get_logger()
SimpleHTTPRequestHandler.__init__(self, req, addr, server)
示例4: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, client_addr, server):
"""Constructor, call the base constructor and set up session."""
# Track if this was an authenticated request
self.authenticated = False
SimpleHTTPRequestHandler.__init__(self, req, client_addr, server)
self.protocol_version = 'HTTP/1.1'
示例5: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, addr, only_upgrade=False):
self.only_upgrade = only_upgrade # only allow upgrades
SimpleHTTPRequestHandler.__init__(self, req, addr, object())
示例6: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, client_addr, server):
""" Contructor, call the base constructor and set up session """
self._session = None
SimpleHTTPRequestHandler.__init__(self, req, client_addr, server)
示例7: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
self.filename = server.filename
# after the following line, no code gets executed:
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
示例8: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server, logger):
self.logger = logger
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
示例9: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
self.protocol_version = "HTTP/1.0"
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
self.params = self.fragment = self.query = self.fragment = None
示例10: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, req, client_addr, server):
SimpleHTTPRequestHandler.__init__(self, req, client_addr, server)
示例11: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
if py3:
super(MyHTTPRequestHandler, self).__init__(request, client_address, server)
else:
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
示例12: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
self._server = server
self.protocol_version = PROTOCOL_VERSION_1_1
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
示例13: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.node_dir = os.sep + "node_modules"
self.main_dir = os.sep.join(os.getcwd().split(os.sep)[:-2])
SimpleHTTPRequestHandler.__init__(self, *args, **kwargs)
示例14: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server):
if py3:
super(BetterHTTPRequestHandler, self).__init__(request, client_address, server)
else:
SimpleHTTPRequestHandler.__init__(self, request, client_address, server)
self.static_files_dir = self.server.static_files_dir[:] # force a copy
示例15: __init__
# 需要导入模块: from http.server import SimpleHTTPRequestHandler [as 别名]
# 或者: from http.server.SimpleHTTPRequestHandler import __init__ [as 别名]
def __init__(self, request, client_address, server_socket):
SimpleHTTPRequestHandler.__init__(self, request, client_address, server_socket)