BaseTools: Move OverrideAttribs to OptRomInfStatement.py
authorGary Lin <glin@suse.com>
Fri, 13 Jul 2018 10:18:34 +0000 (18:18 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 16 Jul 2018 03:22:13 +0000 (11:22 +0800)
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 <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/OptRomInfStatement.py

index 5ff2e20..4be790a 100644 (file)
@@ -4493,7 +4493,7 @@ class FdfParser:
     #\r
     def __GetOptRomOverrides(self, Obj):\r
         if self.__IsToken('{'):\r
-            Overrides = OptionRom.OverrideAttribs()\r
+            Overrides = OptRomInfStatement.OverrideAttribs()\r
             while True:\r
                 if self.__IsKeyword( "PCI_VENDOR_ID"):\r
                     if not self.__IsToken( "="):\r
index dfeba5d..e416b83 100644 (file)
@@ -45,9 +45,8 @@ class OptRomInfStatement (FfsInfStatement):
     #   @param  self        The object pointer\r
     #\r
     def __GetOptRomParams(self):\r
-        from . import OptionRom\r
         if self.OverrideAttribs is None:\r
-            self.OverrideAttribs = OptionRom.OverrideAttribs()\r
+            self.OverrideAttribs = OverrideAttribs()\r
 \r
         if self.OverrideAttribs.NeedCompress is None:\r
             self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS')\r
@@ -150,3 +149,17 @@ class OptRomInfStatement (FfsInfStatement):
                     OutputFileList.extend(FileList)\r
 \r
         return OutputFileList\r
+\r
+class OverrideAttribs:\r
+\r
+    ## The constructor\r
+    #\r
+    #   @param  self        The object pointer\r
+    #\r
+    def __init__(self):\r
+\r
+        self.PciVendorId = None\r
+        self.PciClassCode = None\r
+        self.PciDeviceId = None\r
+        self.PciRevision = None\r
+        self.NeedCompress = None\r