From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9F927211D505C for ; Wed, 20 Jun 2018 21:44:53 -0700 (PDT) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Thu, 21 Jun 2018 06:44:50 +0200 From: Gary Lin To: edk2-devel@lists.01.org Cc: Yonghong Zhu , Liming Gao Date: Thu, 21 Jun 2018 12:43:44 +0800 Message-Id: <20180621044346.28495-19-glin@suse.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621044346.28495-1-glin@suse.com> References: <20180621044346.28495-1-glin@suse.com> Subject: [PATCH v3 18/20] BaseTools: Move OverrideAttribs to OptRomInfStatement.py X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2018 04:44:54 -0000 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 --- BaseTools/Source/Python/GenFds/FdfParser.py | 2 +- BaseTools/Source/Python/GenFds/OptRomInfStatement.py | 17 ++++++++++++++--- BaseTools/Source/Python/GenFds/OptionRom.py | 14 -------------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index b7c4bb35a4e2..349f17bea5e0 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -4428,7 +4428,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 b377b6a7ba33..e1d607669fbf 100644 --- a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py @@ -46,9 +46,8 @@ class OptRomInfStatement (FfsInfStatement): # 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') @@ -152,4 +151,16 @@ class OptRomInfStatement (FfsInfStatement): 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 901b5c4f3318..e82c94884ab2 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.17.1