def __init__(self): self.alias_cache = {} self.dri_list = {} self.status, self.output = ui_down() if self.status: return dri_xml = Parser() dri_xml.feed(self.output) dri_xml.close() self.vendor_pattern_re = re.compile('(pci|usb):v([0-9A-F]{4,8})(?:d|p)') self.key_pattern_re = re.compile('(pci|usb):v([0-9A-F]{4,8})(?:d|p)([0-9A-F]{4,8})') dri_db = dri_xml.pcid.iteritems() '''web''' for pkg, pci_map in dri_db: for module, aliases in pci_map.iteritems(): for alias in aliases: vp = self.vendor_pattern_re.match(alias) if vp: self.alias_cache.setdefault(vp.group(1), {}).setdefault(vp.group(2), \ {}).setdefault(alias, []).append((module, pkg))
def __init__(self): self.alias_cache = {} self.dri_list = {} self.status, self.output = ui_down() if self.status: return dri_xml = Parser() dri_xml.feed(self.output) dri_xml.close() self.vendor_pattern_re = re.compile( '(pci|usb):v([0-9A-F]{4,8})(?:d|p)') self.key_pattern_re = re.compile( '(pci|usb):v([0-9A-F]{4,8})(?:d|p)([0-9A-F]{4,8})') dri_db = dri_xml.pcid.iteritems() '''web''' for pkg, pci_map in dri_db: for module, aliases in pci_map.iteritems(): for alias in aliases: vp = self.vendor_pattern_re.match(alias) if vp: self.alias_cache.setdefault(vp.group(1), {}).setdefault(vp.group(2), \ {}).setdefault(alias, []).append((module, pkg))
def __init__(self): self.alias_cache = {} status, output = cmd_down() if status: print _(output) return None p = Parser() p.feed(output) p.close() self.vendor_pattern_re = re.compile("(pci|usb):v([0-9A-F]{4,8})(?:d|p)") self.alias_cache = {} db = p.pcid.iteritems() for pkg, pci_map in db: for module, aliases in pci_map.iteritems(): for alias in aliases: vp = self.vendor_pattern_re.match(alias) if vp: self.alias_cache.setdefault(vp.group(1), {}).setdefault(vp.group(2), {}).setdefault( alias, [] ).append((module, pkg)) else: colon = alias.find(":") if colon > 0: bus = alias[:colon] else: bus = None self.alias_cache.setdefault(bus, {}).setdefault(None, {}).setdefault(alias, []).append( (module, pkg) ) hardware = self.get_hardware() self.get_db_handlers(hardware)
def __init__(self): self.alias_cache = {} status, output = cmd_down() if status: print _(output) return None p = Parser() p.feed(output) p.close() self.vendor_pattern_re = re.compile( '(pci|usb):v([0-9A-F]{4,8})(?:d|p)') self.alias_cache = {} db = p.pcid.iteritems() for pkg, pci_map in db: for module, aliases in pci_map.iteritems(): for alias in aliases: vp = self.vendor_pattern_re.match(alias) if vp: self.alias_cache.setdefault( vp.group(1), {}).setdefault(vp.group(2), {}).setdefault(alias, []).append( (module, pkg)) else: colon = alias.find(':') if colon > 0: bus = alias[:colon] else: bus = None self.alias_cache.setdefault(bus, {}).setdefault( None, {}).setdefault(alias, []).append( (module, pkg)) hardware = self.get_hardware() self.get_db_handlers(hardware)