当前位置: 首页>>代码示例>>Python>>正文


Python SimpleHTTPRequestHandler.__init__方法代码示例

本文整理汇总了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)
开发者ID:sean-m-brennan,项目名称:pysysdevel,代码行数:9,代码来源:pywebsocketserver.py

示例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())
开发者ID:DirectXMan12,项目名称:websockify,代码行数:9,代码来源:websocket.py

示例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)
开发者ID:kousu,项目名称:websockify,代码行数:19,代码来源:websocket.py

示例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'
开发者ID:1lann,项目名称:home-assistant,代码行数:8,代码来源:http.py

示例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())
开发者ID:Open365,项目名称:spice-web-client,代码行数:5,代码来源:websocket.py

示例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)
开发者ID:LucasZielke,项目名称:home-assistant,代码行数:6,代码来源:http.py

示例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)
开发者ID:konradvoelkel,项目名称:articlechurner,代码行数:6,代码来源:serve-annotator.py

示例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)
开发者ID:natemago,项目名称:srv,代码行数:5,代码来源:srv.py

示例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
开发者ID:nycnighthawk,项目名称:ConfigLine,代码行数:6,代码来源:threaded_http_server.py

示例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)
开发者ID:rpoisel,项目名称:python-in-c,代码行数:4,代码来源:sample.py

示例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)
开发者ID:greeny2612,项目名称:shairport-decoder,代码行数:7,代码来源:webserver.py

示例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)
开发者ID:spiricn,项目名称:ssc,代码行数:8,代码来源:HTTPRequestHandler.py

示例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)
开发者ID:dwillmer,项目名称:playground,代码行数:6,代码来源:server.py

示例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
开发者ID:luckydonald,项目名称:luckydonald-utils,代码行数:8,代码来源:__init__.py

示例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)
开发者ID:netixx,项目名称:NetProbes,代码行数:4,代码来源:http.py


注:本文中的http.server.SimpleHTTPRequestHandler.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。