當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。