From nobody Fri Nov 1 03:31:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522789402348491.15579704749723; Tue, 3 Apr 2018 14:03:22 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 73A53226085AE; Tue, 3 Apr 2018 14:03:14 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 04647226C7C35 for ; Tue, 3 Apr 2018 14:03:12 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 14:03:11 -0700 Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga002.jf.intel.com with ESMTP; 03 Apr 2018 14:03:11 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,402,1517904000"; d="scan'208";a="47710166" From: Jaben Carsey To: edk2-devel@lists.01.org Date: Tue, 3 Apr 2018 14:03:05 -0700 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [edk2] [PATCH v1 05/10] BaseTools - AutoGen - replace custom dictionary class with python standard one 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: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We have a custom ordered dictionary class. works fine with python OrderedD= ict version. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 31 ++++++++++---------- BaseTools/Source/Python/AutoGen/GenMake.py | 3 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 3384fdb70b7e..3865827f26df 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -45,6 +45,7 @@ import InfSectionParser import datetime import hashlib from GenVar import VariableMgr,var_info +from collections import OrderedDict =20 ## Regular expression for splitting Dependency Expression string into toke= ns gDepexTokenPattern =3D re.compile("(\(|\)|\w+| \S+\.inf)") @@ -892,7 +893,7 @@ class WorkspaceAutoGen(AutoGen): ] =20 # This dict store PCDs which are not used by any modules with spec= ified arches - UnusedPcd =3D sdict() + UnusedPcd =3D OrderedDict() for Pa in self.AutoGenObjectList: # Key of DSC's Pcds dictionary is PcdCName, TokenSpaceGuid for Pcd in Pa.Platform.Pcds: @@ -2084,7 +2085,7 @@ class PlatformAutoGen(AutoGen): ## Generate Token Number for all PCD def _GetPcdTokenNumbers(self): if self._PcdTokenNumber is None: - self._PcdTokenNumber =3D sdict() + self._PcdTokenNumber =3D OrderedDict() TokenNumber =3D 1 # # Make the Dynamic and DynamicEx PCD use within different Toke= nNumber area.=20 @@ -2207,8 +2208,8 @@ class PlatformAutoGen(AutoGen): # EdkII module LibraryConsumerList =3D [Module] Constructor =3D [] - ConsumedByList =3D sdict() - LibraryInstance =3D sdict() + ConsumedByList =3D OrderedDict() + LibraryInstance =3D OrderedDict() =20 EdkLogger.verbose("") EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(= Module), self.Arch)) @@ -2880,14 +2881,14 @@ class ModuleAutoGen(AutoGen): self._DerivedPackageList =3D None self._ModulePcdList =3D None self._LibraryPcdList =3D None - self._PcdComments =3D sdict() + self._PcdComments =3D OrderedDict() self._GuidList =3D None self._GuidsUsedByPcd =3D None - self._GuidComments =3D sdict() + self._GuidComments =3D OrderedDict() self._ProtocolList =3D None - self._ProtocolComments =3D sdict() + self._ProtocolComments =3D OrderedDict() self._PpiList =3D None - self._PpiComments =3D sdict() + self._PpiComments =3D OrderedDict() self._DepexList =3D None self._DepexExpressionList =3D None self._BuildOption =3D None @@ -2943,7 +2944,7 @@ class ModuleAutoGen(AutoGen): # Macros could be used in build_rule.txt (also Makefile) def _GetMacros(self): if self._Macro is None: - self._Macro =3D sdict() + self._Macro =3D OrderedDict() self._Macro["WORKSPACE" ] =3D self.WorkspaceDir self._Macro["MODULE_NAME" ] =3D self.Name self._Macro["MODULE_NAME_GUID" ] =3D self._GetUniqueBaseN= ame() @@ -3695,7 +3696,7 @@ class ModuleAutoGen(AutoGen): # def _GetLibraryPcdList(self): if self._LibraryPcdList is None: - Pcds =3D sdict() + Pcds =3D OrderedDict() if not self.IsLibrary: # get PCDs from dependent libraries for Library in self.DependentLibraryList: @@ -3717,7 +3718,7 @@ class ModuleAutoGen(AutoGen): # def _GetGuidList(self): if self._GuidList is None: - self._GuidList =3D sdict() + self._GuidList =3D OrderedDict() self._GuidList.update(self.Module.Guids) for Library in self.DependentLibraryList: self._GuidList.update(Library.Guids) @@ -3727,7 +3728,7 @@ class ModuleAutoGen(AutoGen): =20 def GetGuidsUsedByPcd(self): if self._GuidsUsedByPcd is None: - self._GuidsUsedByPcd =3D sdict() + self._GuidsUsedByPcd =3D OrderedDict() self._GuidsUsedByPcd.update(self.Module.GetGuidsUsedByPcd()) for Library in self.DependentLibraryList: self._GuidsUsedByPcd.update(Library.GetGuidsUsedByPcd()) @@ -3738,7 +3739,7 @@ class ModuleAutoGen(AutoGen): # def _GetProtocolList(self): if self._ProtocolList is None: - self._ProtocolList =3D sdict() + self._ProtocolList =3D OrderedDict() self._ProtocolList.update(self.Module.Protocols) for Library in self.DependentLibraryList: self._ProtocolList.update(Library.Protocols) @@ -3752,7 +3753,7 @@ class ModuleAutoGen(AutoGen): # def _GetPpiList(self): if self._PpiList is None: - self._PpiList =3D sdict() + self._PpiList =3D OrderedDict() self._PpiList.update(self.Module.Ppis) for Library in self.DependentLibraryList: self._PpiList.update(Library.Ppis) @@ -3983,7 +3984,7 @@ class ModuleAutoGen(AutoGen): PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGui= dCName, 'DynamicEx')) PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGui= dCName, 'Dynamic')) PcdTokenSpaceList.append(Pcd.TokenSpaceGuidCName) - GuidList =3D sdict() + GuidList =3D OrderedDict() GuidList.update(self.GuidList) for TokenSpace in self.GetGuidsUsedByPcd(): # If token space is not referred by patch PCD or Ex PCD, remov= e the GUID from GUID list diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index dcdfcca1a5b0..533fdb54231c 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -25,6 +25,7 @@ from Common.Misc import * from Common.String import * from BuildEngine import * import Common.GlobalData as GlobalData +from collections import OrderedDict =20 ## Regular expression for finding header file inclusions gIncludePattern =3D re.compile(r"^[ \t]*#?[ \t]*include(?:[ \t]*(?:\\(?:\r= \n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)"= , re.MULTILINE | re.UNICODE | re.IGNORECASE) @@ -442,7 +443,7 @@ cleanlib: self.LibraryMakefileList =3D [] self.LibraryBuildDirectoryList =3D [] self.SystemLibraryList =3D [] - self.Macros =3D sdict() + self.Macros =3D OrderedDict() self.Macros["OUTPUT_DIR" ] =3D self._AutoGenObject.Macros["OU= TPUT_DIR"] self.Macros["DEBUG_DIR" ] =3D self._AutoGenObject.Macros["DE= BUG_DIR"] self.Macros["MODULE_BUILD_DIR"] =3D self._AutoGenObject.Macros["MO= DULE_BUILD_DIR"] --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel