From 8f3f5794b4b0027ee118fc6e03ea01620e6cd9d4 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Fri, 13 Jul 2018 18:18:34 +0800 Subject: [PATCH] BaseTools: Move OverrideAttribs to OptRomInfStatement.py Move "class OverrideAttribs" to OptRomInfStatement.py to remove "import OptionRom" which may form a circular import: GenFds.OptionRom => GenFds.OptRomInfStatement => GenFds.OptionRom Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin Reviewed-by: Jaben Carsey --- BaseTools/Source/Python/GenFds/FdfParser.py | 2 +- .../Source/Python/GenFds/OptRomInfStatement.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 5ff2e206db..4be790a819 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -4493,7 +4493,7 @@ class FdfParser: # def __GetOptRomOverrides(self, Obj): if self.__IsToken('{'): - Overrides = OptionRom.OverrideAttribs() + Overrides = OptRomInfStatement.OverrideAttribs() while True: if self.__IsKeyword( "PCI_VENDOR_ID"): if not self.__IsToken( "="): diff --git a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py index dfeba5d0b1..e416b838d1 100644 --- a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py @@ -45,9 +45,8 @@ class OptRomInfStatement (FfsInfStatement): # @param self The object pointer # def __GetOptRomParams(self): - from . import OptionRom if self.OverrideAttribs is None: - self.OverrideAttribs = OptionRom.OverrideAttribs() + self.OverrideAttribs = OverrideAttribs() if self.OverrideAttribs.NeedCompress is None: self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS') @@ -150,3 +149,17 @@ class OptRomInfStatement (FfsInfStatement): OutputFileList.extend(FileList) return OutputFileList + +class OverrideAttribs: + + ## The constructor + # + # @param self The object pointer + # + def __init__(self): + + self.PciVendorId = None + self.PciClassCode = None + self.PciDeviceId = None + self.PciRevision = None + self.NeedCompress = None -- 2.39.2