コード例 #1
0
ファイル: creator.py プロジェクト: chinjieh/mugenplcfg
    def getPciConfigAddress(self, path):
        pciconfigaddr = ""
        key = "PCI MMCONFIG"
        try:
            iomemdata = extractor.extractData(path)
            keyline = parseutil.findLines(iomemdata, key)[0]
            pciconfigaddr = keyline.split("-")[0].lstrip()

        except (customExceptions.KeyNotFound, IOError):
            message.addWarning(
                "Could not obtain pciConfigAddress from %s." % path)

        return pciconfigaddr
コード例 #2
0
ファイル: creator.py プロジェクト: chinjieh/mugenplcfg
 def getClassName(self, devicepath, pciIdsParser):
     "Checks the pciIdsParser object and gets the class name for the device"
     # Get class code from "class" file"
     classcode = extractor.extractData(
         os.path.join(devicepath, "class"))[0:8]
     classname = classcode
     try:
         classname = pciIdsParser.getClassName(classcode[0:6])
         classname = util.spacesToUnderscores(classname.lower())
     except (customExceptions.PciIdsFailedSearch,
             customExceptions.PciIdsSubclassNotFound):
         message.addWarning(("Name for Device at: %s " % devicepath +
                             "could not be found. It would " +
                             "be a good idea to update pci.ids " +
                             "(try '-update' or '-u')"))
     return classname