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


Python BaseHTTPRequestHandler.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from BaseHTTPServer import BaseHTTPRequestHandler [as 别名]
# 或者: from BaseHTTPServer.BaseHTTPRequestHandler import __init__ [as 别名]
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("angle",float)
        self.createAttribute("direction",int)
        self.createAttribute("function",int)
        self.createAttribute("length",int)
        self.createAttribute("name",str)
        self.createAttribute("net",str)
        self.createAttribute("route",int)
        self.createAttribute("swaplevel",int)
        self.createAttribute("visible",int)
        self.createAttribute("x",int)
        self.createAttribute("y",int)
        self.createAttribute("circles",[ULCircle])
        self.createAttribute("contacts",[ULContact])
        self.createAttribute("texts",[ULText])
        self.createAttribute("wires",[ULWire]) 
开发者ID:rmawatson,项目名称:PyEagle,代码行数:19,代码来源:Eaglepy.py

示例2: __init__

# 需要导入模块: from BaseHTTPServer import BaseHTTPRequestHandler [as 别名]
# 或者: from BaseHTTPServer.BaseHTTPRequestHandler import __init__ [as 别名]
def __init__(self):
        self.registry = CollectorRegistry()
        self.prodstack = {}
        with open(config['cache_file'], 'rb') as f:
            self.prodstack = pickle.load(f)[0]
        self.hypervisors = self.prodstack['hypervisors']
        self.tenant_map = {t['id']: t['name'] for t in self.prodstack['tenants']}
        self.flavor_map = {f['id']: {'ram': f['ram'], 'disk': f['disk'], 'vcpus': f['vcpus']}
                           for f in self.prodstack['flavors']}
        self.aggregate_map = {}
        self.services_map = {}
        for s in self.prodstack['services']:
            if s['binary'] == 'nova-compute':
                self.services_map[s['host']] = s['status']
        for agg in self.prodstack['aggregates']:
            self.aggregate_map.update({i: agg['name'] for i in agg['hosts']}) 
开发者ID:CanonicalLtd,项目名称:prometheus-openstack-exporter,代码行数:18,代码来源:prometheus_openstack_exporter.py

示例3: __init__

# 需要导入模块: from BaseHTTPServer import BaseHTTPRequestHandler [as 别名]
# 或者: from BaseHTTPServer.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


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