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 v2 18/20] BaseTools: Move OverrideAttribs to OptRomInfStatement.py
Date: Thu, 1 Feb 2018 16:36:06 +0800 [thread overview]
Message-ID: <20180201083608.16036-19-glin@suse.com> (raw)
In-Reply-To: <20180201083608.16036-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 | 18 ++++++++++++++++--
BaseTools/Source/Python/GenFds/OptionRom.py | 14 --------------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 4e07d04c08df..52e4727e38a6 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -4481,7 +4481,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 5de0cac2a374..a12230fe21ee 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 == None:
- self.OverrideAttribs = OptionRom.OverrideAttribs()
+ self.OverrideAttribs = OverrideAttribs()
if self.OverrideAttribs.NeedCompress == None:
self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS')
@@ -151,3 +150,18 @@ 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
diff --git a/BaseTools/Source/Python/GenFds/OptionRom.py b/BaseTools/Source/Python/GenFds/OptionRom.py
index a7a63e80845c..01846eb01440 100644
--- a/BaseTools/Source/Python/GenFds/OptionRom.py
+++ b/BaseTools/Source/Python/GenFds/OptionRom.py
@@ -123,17 +123,3 @@ class OPTIONROM (OptionRomClassObject):
GenFdsGlobalVariable.SharpCounter = 0
return OutputFile
-
-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.16.1
next prev parent reply other threads:[~2018-02-01 8:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 8:35 [PATCH v2 00/20] BaseTools: One step toward python3 Gary Lin
2018-02-01 8:35 ` [PATCH v2 01/20] BaseTools: Refactor python except statements Gary Lin
2018-02-01 8:35 ` [PATCH v2 02/20] BaseTools: Refactor python print statements Gary Lin
2018-02-01 8:35 ` [PATCH v2 03/20] BaseTools: Remove the old python "not-equal" Gary Lin
2018-02-01 8:35 ` [PATCH v2 04/20] BaseTools: Use the python3-range functions Gary Lin
2018-02-01 8:35 ` [PATCH v2 05/20] BaseTools: Remove tuple parameter in python scripts Gary Lin
2018-02-01 8:35 ` [PATCH v2 06/20] BaseTools: Remove the deprecated hash_key() Gary Lin
2018-02-01 8:35 ` [PATCH v2 07/20] BaseTools: Import reduce() from functools Gary Lin
2018-02-01 8:35 ` [PATCH v2 08/20] BaseTools: Replace StandardError with Expression Gary Lin
2018-02-01 8:35 ` [PATCH v2 09/20] BaseTools: Remove types.TypeType Gary Lin
2018-02-01 8:35 ` [PATCH v2 10/20] BaseTools: Refactor python raise statement Gary Lin
2018-02-01 8:35 ` [PATCH v2 11/20] BaseTools: Adjust the spaces around commas and colons Gary Lin
2018-02-01 8:36 ` [PATCH v2 12/20] BaseTools: Migrate to the new octal literal Gary Lin
2018-02-01 8:36 ` [PATCH v2 13/20] BaseTools: Unify long int and int in python scripts Gary Lin
2018-02-01 8:36 ` [PATCH v2 14/20] BaseTools: Adjust old python2 idioms Gary Lin
2018-02-01 8:36 ` [PATCH v2 15/20] BaseTools: Replace StringIO.StringIO with io.BytesIO Gary Lin
2018-02-01 8:36 ` [PATCH v2 16/20] BaseTools: Treat GenFds.py and build.py as python modules Gary Lin
2018-02-01 8:36 ` [PATCH v2 17/20] BaseTools: Adopt absolute import for python scripts Gary Lin
2018-02-01 8:36 ` Gary Lin [this message]
2018-02-01 8:36 ` [PATCH v2 19/20] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py Gary Lin
2018-02-01 8:36 ` [PATCH v2 20/20] BaseTools: Move ImageBinDict " Gary Lin
2018-06-20 6:22 ` [PATCH v2 00/20] BaseTools: One step toward python3 Paolo Bonzini
2018-06-20 7:29 ` Zhu, Yonghong
2018-06-20 8:08 ` 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=20180201083608.16036-19-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