當前位置: 首頁>>代碼示例>>Python>>正文


Python BaseHTTPRequestHandler.__init__方法代碼示例

本文整理匯總了Python中http.server.BaseHTTPRequestHandler.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python BaseHTTPRequestHandler.__init__方法的具體用法?Python BaseHTTPRequestHandler.__init__怎麽用?Python BaseHTTPRequestHandler.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在http.server.BaseHTTPRequestHandler的用法示例。


在下文中一共展示了BaseHTTPRequestHandler.__init__方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self):
        self.hostname = None
        self.port = None

        #這是請求
        self.command = None
        self.path = None
        self.request_version = None

        #這是響應
        self.response_version = None
        self.status = None
        self.reason = None

        self._headers = None

        self._body = b'' 
開發者ID:qiyeboy,項目名稱:BaseProxy,代碼行數:19,代碼來源:proxy.py

示例2: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, app, sessions, *args, **kwargs):
        """
        Constructor.
        """
        # Sessions array in shared memory.
        self.sessions = sessions
        # Application instance.
        self.app = app
        # HTTP server version.
        self.server_version = "temboard-agent/%s" % temboard_version
        # HTTP request method
        self.http_method = None
        # HTTP query.
        self.query = None
        # HTTP POST content in json format.
        self.post_json = None
        # Call HTTP request handler constructor.
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs) 
開發者ID:dalibo,項目名稱:temboard-agent,代碼行數:20,代碼來源:httpd.py

示例3: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, server_address, handler_class, config,
                 bind_and_activate=True):
        # pylint: disable=super-init-not-called, non-parent-init-called
        # Init just BaseServer, TCPServer creates a socket.
        BaseServer.__init__(self, server_address, handler_class)

        if isinstance(server_address, socket.socket):
            # It's a bound and activates socket from systemd.
            self.socket = server_address
            bind_and_activate = False
        else:
            self.socket = socket.socket(self.address_family,
                                        self.socket_type)

        # copied from TCPServer
        if bind_and_activate:
            try:
                self.server_bind()
                self.server_activate()
            except BaseException:
                self.server_close()
                raise

        if self.socket.family == socket.AF_UNIX:
            self.socket_file = self.socket.getsockname()

        if 'consumers' not in config:
            raise ValueError('Configuration does not provide any consumer')
        self.config = config
        if 'server_string' in self.config:
            self.server_string = self.config['server_string']
        self.auditlog = log.auditlog 
開發者ID:latchset,項目名稱:custodia,代碼行數:34,代碼來源:server.py

示例4: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, token, d, *args):
        self.d = d
        self.token = token
        BaseHTTPRequestHandler.__init__(self, *args) 
開發者ID:0ang3el,項目名稱:aem-hacker,代碼行數:6,代碼來源:aem_hacker.py

示例5: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, response_str):
        self._file = BytesIO(response_str) 
開發者ID:epinna,項目名稱:weevely3,代碼行數:4,代碼來源:proxy.py

示例6: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, *args):
        self.sinkname = self.__class__.__name__
        BaseHTTPRequestHandler.__init__(self, *args) 
開發者ID:hangoutsbot,項目名稱:hangoutsbot,代碼行數:5,代碼來源:base_bot_request_handler.py

示例7: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, config):
        super(AgentApi, self).__init__(config)
        self._enabled = config.fetch('agent', 'enabled', bool)
        self.host = config.fetch('agent', 'host')
        self.port = config.fetch('agent', 'port', int) 
開發者ID:postgrespro,項目名稱:mamonsu,代碼行數:7,代碼來源:agent.py

示例8: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, cloudpath, *args):
    self.storage = Storage(cloudpath)
    BaseHTTPRequestHandler.__init__(self, *args) 
開發者ID:seung-lab,項目名稱:cloud-volume,代碼行數:5,代碼來源:server.py

示例9: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, cutouts, *args):
    self.cutouts = cutouts
    BaseHTTPRequestHandler.__init__(self, *args) 
開發者ID:seung-lab,項目名稱:cloud-volume,代碼行數:5,代碼來源:__init__.py

示例10: __init__

# 需要導入模塊: from http.server import BaseHTTPRequestHandler [as 別名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 別名]
def __init__(self, request, address, server, xsrf_token):
        self.xsrf_token = xsrf_token
        self.access_token = None
        BaseHTTPRequestHandler.__init__(self, request, address, server) 
開發者ID:alerta,項目名稱:python-alerta-client,代碼行數:6,代碼來源:token.py


注:本文中的http.server.BaseHTTPRequestHandler.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。