Ejemplo n.º 1
0
 def getDeviceName(self, venhex, devhex):
     vencode = util.stripvalue(venhex, True)
     devcode = util.stripvalue(devhex, True)
     try:
         result = self.deviceData[(vencode, devcode)]
         return result
     except KeyError:
         raise customExceptions.PciIdsFailedSearch(
             "Could not find device: %s of vendor: %s" % (devhex, venhex))
Ejemplo n.º 2
0
 def getVendorName(self, venhex):
     vencode = util.stripvalue(venhex, True)
     try:
         result = self.vendorData[vencode]
         return result
     except KeyError:
         raise customExceptions.PciIdsFailedSearch(
             "Could not find vendor: %s" % venhex)
Ejemplo n.º 3
0
    def getClassName(self, clshex):
        "Searches first 4 digits of class code e.g. 0604 in self.classData"
        clscode = util.stripvalue(clshex, True)
        result = ""
        try:
            result = self.classData[clscode]

        except KeyError:  # Could not find subclass, trying to find class...
            try:
                result = self.classData[clscode[:PciIdsParser.CLASS_LENGTH]]
                raise customExceptions.PciIdsSubclassNotFound(
                    "Could not find subclass: %s" % clshex)

            except KeyError:
                raise customExceptions.PciIdsFailedSearch(
                    "Could not find class: %s" % clshex)

        return result