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


Python BaseHTTPRequestHandler.__init__方法代码示例

本文整理汇总了Python中http.server.BaseHTTPRequestHandler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseHTTPRequestHandler.__init__方法的具体用法?Python BaseHTTPRequestHandler.__init__怎么用?Python BaseHTTPRequestHandler.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在http.server.BaseHTTPRequestHandler的用法示例。


在下文中一共展示了BaseHTTPRequestHandler.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     from django.conf import settings
     self.admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
     # We set self.path to avoid crashes in log_message() on unsupported
     # requests (like "OPTIONS").
     self.path = ''
     BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:gitdlam,项目名称:geraldo,代码行数:9,代码来源:basehttp.py

示例2: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, request, client_address, origin):
   self.origin = origin
   #if __name__ != '__main__':
   #  self.origin.log('postman initializing as plugin..', 2)
   #else:
   #  self.origin.log('postman initializing as standalone application..', 2)
   # ^ works
   BaseHTTPRequestHandler.__init__(self, request, client_address, origin)
开发者ID:majestrate,项目名称:SRNd,代码行数:10,代码来源:postman.py

示例3: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     from google.appengine._internal.django.conf import settings
     self.admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
     # We set self.path to avoid crashes in log_message() on unsupported
     # requests (like "OPTIONS").
     self.path = ''
     self.style = color_style()
     BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:zenlambda,项目名称:appengine-python3,代码行数:10,代码来源:basehttp.py

示例4: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, request, client_address, server):
     '''
     :param request: the request from the client
     :param client_address: client address
     :param server: HTTP server
     '''
     BaseHTTPRequestHandler.__init__(
         self, request, client_address, server)
     self.dataman = None
开发者ID:dark-lbp,项目名称:kitty,代码行数:11,代码来源:web.py

示例5: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, request, client_address, server):
        try:
            mimetypes.init()
            self.DebugMode = False

            BaseHTTPRequestHandler.__init__(self, request, client_address, server)

        except:
            ReportException()
开发者ID:CarlosOnline,项目名称:Python,代码行数:11,代码来源:WebServer.py

示例6: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     sock = socket_wrapper.Socket(unix_socket=True)
     sock.make_nonblocking()
     if not sock.connect_unix(os.path.expanduser(PETTYCOIN_SOCKET)):
         logging.error('Could not open socket: {}'.format(PETTYCOIN_SOCKET))
         sys.exit(1)
     self.petty_sock = sock
     self.petty_reader = JsonSocketReader(sock)
     self.html_parser = HTMLParser()
     BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:arhuaco,项目名称:pypettycoin,代码行数:12,代码来源:bad_proxy.py

示例7: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, http_svc, *args, **kwargs):
        """
        Sets up the request handler (called for each request)

        :param http_svc: The associated HTTP service
        """
        self._service = http_svc

        # This calls the do_* methods
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:ahmadshahwan,项目名称:cohorte-runtime,代码行数:12,代码来源:basic.py

示例8: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, http_svc, *args, **kwargs):
        """
        Constructor
        
        :param http_svc: The associated HTTP service instance
        """
        # Store the reference to the service
        self.service = http_svc

        # Call the parent constructor
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:Netcondut,项目名称:ipopo,代码行数:13,代码来源:http_svc.py

示例9: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, request, client, server):
     request.settimeout(60.)
     try:
         BaseHTTPRequestHandler.__init__(self, request, client, server)
     except OSError as e:
         if server.debug:
             logger.exception("OSError in http request")
         else:
             logger.error("%s", e)
     except Exception:
         logger.exception("Unhandle Error")
开发者ID:flux3dp,项目名称:fluxghost,代码行数:13,代码来源:http_handler.py

示例10: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, request, client_address, server):
        """
        override default baseHTTP info
        add some variables like: cookies, query, path, etc.
        """
        self.server_version = 'Thorin/1.0.3'
        self.request_version = 'HTTP/1.1'
        self.sys_version = ''
        self.response_time = time.time()
        self.cookies = {}
        self.query = {}
        self.path = {}
        self.remote_ip = ''

        BaseHTTPRequestHandler.__init__(self, request, client_address, server)
开发者ID:philsitumorang,项目名称:thorin,代码行数:17,代码来源:server.py

示例11: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, request, client_address, server, cpu):
        log.error("ControlHandler %s %s %s", request, client_address, server)
        self.cpu = cpu

        self.get_urls = {
            r"/disassemble/(\s+)/$": self.get_disassemble,
            r"/memory/(\s+)(-(\s+))?/$": self.get_memory,
            r"/memory/(\s+)(-(\s+))?/raw/$": self.get_memory_raw,
            r"/status/$": self.get_status,
            r"/$": self.get_index,
        }

        self.post_urls = {
            r"/memory/(\s+)(-(\s+))?/$": self.post_memory,
            r"/memory/(\s+)(-(\s+))?/raw/$": self.post_memory_raw,
            r"/quit/$": self.post_quit,
            r"/reset/$": self.post_reset,
            r"/debug/$": self.post_debug,
        }

        BaseHTTPRequestHandler.__init__(self, request, client_address, server)
开发者ID:6809,项目名称:MC6809,代码行数:23,代码来源:cpu_control_server.py

示例12: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        """
        """
        global  Gd_internalvar
        self.__name__           = 'StoreHandler'
        self.d_ctlVar           = Gd_internalvar
        b_test                  = False

        self.b_useDebug         = False
        self.str_debugFile      = '/tmp/pfioh-log.txt'
        self.b_quiet            = True
        self.dp                 = pfmisc.debug(    
                                            verbosity   = 0,
                                            level       = -1,
                                            within      = self.__name__
                                            )
        self.pp                 = pprint.PrettyPrinter(indent=4)

        for k,v in kwargs.items():
            if k == 'test': b_test  = True

        if not b_test:
            BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
开发者ID:rockash,项目名称:pfioh,代码行数:25,代码来源:pfioh.py

示例13: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, config, *args):
     self.sender = config.sender
     BaseHTTPRequestHandler.__init__(self, *args)
开发者ID:edib,项目名称:mamonsu,代码行数:5,代码来源:agent.py

示例14: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self,request,client_addr,server):
     self.is_connected = False
     BaseHTTPRequestHandler.__init__(self,request,client_addr,server)
开发者ID:BLACKSNAKE77,项目名称:BaseProxy,代码行数:5,代码来源:proxy.py

示例15: __init__

# 需要导入模块: from http.server import BaseHTTPRequestHandler [as 别名]
# 或者: from http.server.BaseHTTPRequestHandler import __init__ [as 别名]
 def __init__(self, request, client_address, server):
     BaseHTTPRequestHandler.__init__(self, request, client_address, server)
开发者ID:boundlessgeo,项目名称:qgis-server-oauth2-auth-plugin,代码行数:4,代码来源:qgis_wrapped_server.py


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