public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: Yonghong Zhu <yonghong.zhu@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 03/14] BaseTools: Move OverrideAttribs to OptRomInfStatement.py
Date: Tue, 10 Jul 2018 11:30:56 +0800	[thread overview]
Message-ID: <20180710033107.32359-4-glin@suse.com> (raw)
In-Reply-To: <20180710033107.32359-1-glin@suse.com>

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>
---
 BaseTools/Source/Python/GenFds/FdfParser.py          |  2 +-
 BaseTools/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 c890f2d3afb6..8125ffaf32be 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -4440,7 +4440,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 dfeba5d0b140..e416b838d1e4 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.18.0



  parent reply	other threads:[~2018-07-10  3:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10  3:30 [PATCH 00/14] BaseTools: Adopt absolute import Gary Lin
2018-07-10  3:30 ` [PATCH 01/14] BaseTools: Treat GenFds.py as a python module Gary Lin
2018-07-10  3:30 ` [PATCH 02/14] BaseTools: Use absolute import in GenFds Gary Lin
2018-07-10  3:30 ` Gary Lin [this message]
2018-07-10  3:30 ` [PATCH 04/14] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py Gary Lin
2018-07-10  3:30 ` [PATCH 05/14] BaseTools: Move ImageBinDict " Gary Lin
2018-07-10  3:30 ` [PATCH 06/14] BaseTools: Use absolute import in AutoGen Gary Lin
2018-07-10  3:31 ` [PATCH 07/14] BaseTools: Use absolute import in BPDG Gary Lin
2018-07-12  0:52   ` Zhu, Yonghong
2018-07-12  4:23     ` Gary Lin
2018-07-10  3:31 ` [PATCH 08/14] BaseTools: Use absolute import in Common Gary Lin
2018-07-10  3:31 ` [PATCH 09/14] BaseTools: Use absolute import in ECC Gary Lin
2018-07-10  3:31 ` [PATCH 10/14] BaseTools: Use absolute import in Eot Gary Lin
2018-07-10  3:31 ` [PATCH 11/14] BaseTools: Use absolute import in Table Gary Lin
2018-07-10  3:31 ` [PATCH 12/14] BaseTools: Use absolute import in UPT Gary Lin
2018-07-10  3:31 ` [PATCH 13/14] BaseTools: Use absolute import in Workspace Gary Lin
2018-07-10  3:31 ` [PATCH 14/14] BaseTools: Use absolute import in Scripts Gary Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180710033107.32359-4-glin@suse.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox