Python BaseHTTPServer.BaseHTTPRequestHandler.__init__() Examples

The following are 30 code examples of BaseHTTPServer.BaseHTTPRequestHandler.__init__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module BaseHTTPServer.BaseHTTPRequestHandler , or try the search function .
Example #1
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("area",ULArea)
        self.createAttribute("description",str)
        self.createAttribute("grid",ULGrid)
        self.createAttribute("headline",str)
        self.createAttribute("name",str)
        self.createAttribute("attributes",[ULAttribute])
        self.createAttribute("circles",[ULCircle])
        self.createAttribute("classes",[ULClass])
        self.createAttribute("dimensions",[ULDimension])
        self.createAttribute("elements",[ULElement])
        self.createAttribute("frames",[ULFrame])
        self.createAttribute("holes",[ULHole])
        self.createAttribute("layers",[ULLayer])
        self.createAttribute("libraries",[ULLibrary])
        self.createAttribute("polygons",[ULPolygon])
        self.createAttribute("rectangles",[ULRectangle])
        self.createAttribute("signals",[ULSignal])          
        self.createAttribute("texts",[ULText])
        self.createAttribute("variantdefs",[ULVariantDef])
        self.createAttribute("wires",[ULWire]) 
Example #2
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
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]) 
Example #3
Source File: prometheus_openstack_exporter.py    From prometheus-openstack-exporter with GNU General Public License v3.0 6 votes vote down vote up
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']}) 
Example #4
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("area",ULArea)
        self.createAttribute("description",str)
        self.createAttribute("headline",str)
        self.createAttribute("library",str)
        self.createAttribute("name",str)
        self.createAttribute("circles",[ULCircle])
        self.createAttribute("contacts",[ULContact])
        self.createAttribute("dimensions",[ULDimension])
        self.createAttribute("frames",[ULFrame])
        self.createAttribute("holes",[ULHole])
        self.createAttribute("polygons",[ULPolygon])
        self.createAttribute("rectangles",[ULRectangle])
        self.createAttribute("texts",[ULText])
        self.createAttribute("wires",[ULWire]) 
Example #5
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("angle",float)
        self.createAttribute("attribute",str,args=[(str)])
        self.createAttribute("column",str)
        self.createAttribute("locked",int)
        self.createAttribute("mirror",int)
        self.createAttribute("name",str)
        self.createAttribute("package",ULPackage)
        self.createAttribute("populate",int)
        self.createAttribute("row",str)
        self.createAttribute("smashed",int)
        self.createAttribute("spin",int)
        self.createAttribute("value",int)
        self.createAttribute("x",int)
        self.createAttribute("y",int)
        self.createAttribute("attributes",[ULAttribute])
        self.createAttribute("texts",[ULText])
        self.createAttribute("variants",[ULVariant]) 
Example #6
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,contextObject):
        list.__init__(self)
        self.contextObject = contextObject
        self.groupsFilePath = None
        self._enabledupdates = True
        
        if not self.contextObject in [ULBoard,ULSchematic]:
            raise EaglepyException("Invalid context object")
       
        matches = re.match("(.+)\.[\w\d]+",self.contextObject().name())
        if not matches or len(matches.groups()) < 1:
            return
         
        self.groupsFilePath = matches.groups()[0] + ".epy"
        
        self._loadfromxml() 
Example #7
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("alwaysvectorfont",int)
        self.createAttribute("description",str)
        self.createAttribute("grid",ULGrid)
        self.createAttribute("headline",str)
        self.createAttribute("name",str)
        self.createAttribute("verticaltext",int)
        self.createAttribute("xreflabel",str)
        self.createAttribute("attributes",[ULAttribute])
        self.createAttribute("classes",[ULClass])
        self.createAttribute("layers",[ULLayer])
        self.createAttribute("libraries",[ULLibrary])
        self.createAttribute("nets",[ULNet])
        self.createAttribute("parts",[ULPart])          
        self.createAttribute("sheets",[ULSheet])
        self.createAttribute("instances",[ULInstance])
        self.createAttribute("variantdefs",[ULVariantDef]) 
Example #8
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 6 votes vote down vote up
def __init__(self,parent=None):
        ULObject.__init__(self,parent)
        self.createAttribute("angle",float)
        self.createAttribute("column",str)
        self.createAttribute("gate",ULGate)
        self.createAttribute("mirror",int)
        self.createAttribute("name",str)
        #self.createAttribute("part",ULPart)
        self.createAttribute("row",str)
        self.createAttribute("sheet",int)
        self.createAttribute("smashed",int)
        self.createAttribute("value",str)
        self.createAttribute("x",int)
        self.createAttribute("y",int)
        self.createAttribute("attributes",[ULAttribute])
        self.createAttribute("texts",[ULText])
        self.createAttribute("xrefs",[ULGate]) 
Example #9
Source File: agent.py    From mamonsu with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, config, *args):
        self.sender = config.sender
        BaseHTTPRequestHandler.__init__(self, *args) 
Example #10
Source File: basehttp.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def __init__(self, application, media_dir=None):
        from google.appengine._internal.django.conf import settings
        self.application = application
        if not media_dir:
            import django
            self.media_dir = os.path.join(django.__path__[0], 'contrib', 'admin', 'media')
        else:
            self.media_dir = media_dir
        self.media_url = settings.ADMIN_MEDIA_PREFIX 
Example #11
Source File: basehttp.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def __init__(self,headers):
        if not isinstance(headers, list):
            raise TypeError("Headers must be a list of name/value tuples")
        self._headers = headers 
Example #12
Source File: basehttp.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def __init__(self, filelike, blksize=8192):
        self.filelike = filelike
        self.blksize = blksize
        if hasattr(filelike,'close'):
            self.close = filelike.close 
Example #13
Source File: feedfetcher.py    From Rss-Atom-Feed-Integration-for-Mattermost with MIT License 5 votes vote down vote up
def __init__(self, request, client_address, server):
        self.data = {
            'response_type': 'ephemeral'
        }
        if len(settings.integration_bot_name) > 0:
            self.data['username'] = settings.integration_bot_name
        if len(settings.integration_bot_img) > 0:
            self.data['icon_url'] = settings.integration_bot_img

        BaseHTTPRequestHandler.__init__(self, request, client_address, server) 
Example #14
Source File: prometheus_openstack_exporter.py    From prometheus-openstack-exporter with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs) 
Example #15
Source File: prometheus_openstack_exporter.py    From prometheus-openstack-exporter with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        self.registry = CollectorRegistry()
        self.baseurl = 'http://{}:6000/recon/{}'
        self.swift_hosts = config.get('swift_hosts', []) 
Example #16
Source File: basehttp.py    From python-compat-runtime with Apache License 2.0 5 votes vote down vote up
def __init__(self, stdin, stdout, stderr, environ, multithread=True,
        multiprocess=False):
        self.stdin = stdin
        self.stdout = stdout
        self.stderr = stderr
        self.base_env = environ
        self.wsgi_multithread = multithread
        self.wsgi_multiprocess = multiprocess 
Example #17
Source File: agent.py    From mamonsu with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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) 
Example #18
Source File: advent_http.py    From bwx-adventure with MIT License 5 votes vote down vote up
def __init__(self, port):
    def handler(*args):
      RequestHandler(*args)
    global games
    games = Game.get_registered_games()
    HTTPServer.protocol_version = "HTTP/1.0"
    server = HTTPServer(('0.0.0.0', port), handler)
    server.serve_forever() 
Example #19
Source File: advent_http.py    From bwx-adventure with MIT License 5 votes vote down vote up
def __init__(self, *args):
    BaseHTTPRequestHandler.__init__(self, *args)
    global games
    global state 
Example #20
Source File: advent_http.py    From bwx-adventure with MIT License 5 votes vote down vote up
def __init__(self, game, game_function, session, params):
    self.in_apply = 0
    self.session = session
    self.name = game
    self.game = game_function(game)
    self.game.http_output = True
    self.game.run_init() 
Example #21
Source File: proxy2.py    From scrounger with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, host, port, cert_path):
        super(AsyncThread, self).__init__()
        self._port = port
        self._host = host
        ProxyRequestHandler.cert_path = cert_path
        ProxyRequestHandler.protocol_version = "HTTP/1.1"
        self.server = ThreadingHTTPServer((host, port), ProxyRequestHandler) 
Example #22
Source File: proxy2.py    From scrounger with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.tls = threading.local()
        self.tls.conns = {}

        self.cakey = join_with_script_dir(self.cert_path, "ca.key")
        self.cacert = join_with_script_dir(self.cert_path, "ca.crt")
        self.certkey = join_with_script_dir(self.cert_path, "cert.key")
        self.certdir = join_with_script_dir(self.cert_path, "certs/")

        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)

    # RDC: Want it silent 
Example #23
Source File: simple_web_server.py    From Archive-SE with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args):
        BaseHTTPRequestHandler.__init__(self, *args)

    # Handler for the GET requests 
Example #24
Source File: simple_web_server.py    From Archive-SE with Apache License 2.0 5 votes vote down vote up
def __init__(self, nsa_queue, *args):
		self.nsa_queue = nsa_queue
		BaseHTTPRequestHandler.__init__(self, *args)

	#Handler for the GET requests 
Example #25
Source File: mitmer.py    From MITMer with MIT License 5 votes vote down vote up
def __init__(self, iface_ip, hosts, dnames, conn):

        Process.__init__(self)
        self.iface_ip = iface_ip
        self.hosts = hosts
        self.conn = conn
        self.fp_bank = self.get_fp_bank(dnames)
        self.server_on = False 
Example #26
Source File: mitmer.py    From MITMer with MIT License 5 votes vote down vote up
def __init__(self, fp, dname, port, conn):

        Process.__init__(self)
        self.fp = fp
        self.dname = dname
        self.port = port
        self.conn = conn 
Example #27
Source File: mitmer.py    From MITMer with MIT License 5 votes vote down vote up
def __init__(self, fp, dname, conn, *args):

        self.fp = fp
        self.dname = dname
        self.conn = conn
        BaseHTTPRequestHandler.__init__(self, *args) 
Example #28
Source File: mitmer.py    From MITMer with MIT License 5 votes vote down vote up
def __init__(self, iface, host, conn,
                 skip=["ocsp", ".jpg", ".jpeg", ".gif", ".png", ".css", ".ico", ".js", ".svg"]):

        Thread.__init__(self)
        self.iface = iface
        self.host = host
        self.conn = conn
        self.skip = skip
        self.past_url = None 
Example #29
Source File: mitmer.py    From MITMer with MIT License 5 votes vote down vote up
def __init__(self, iface, iface_mac, gw_ip, gw_mac, host):

        Thread.__init__(self)
        self.iface = iface
        self.iface_mac = iface_mac
        self.gw_ip = gw_ip
        self.gw_mac = gw_mac
        self.host = host
        self.vic_mac = get_mac(host) 
Example #30
Source File: Eaglepy.py    From PyEagle with GNU Lesser General Public License v2.1 5 votes vote down vote up
def __init__(self,name=None):
        self._name = name
        self._parentset = None
        self._enabledupdates = True
        list.__init__(self)