]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/Section.py
BaseTools: use predefined constants instead of local strings
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / Section.py
index 5e0b4bee7d1c509f8f81bedca7b9ee5f3786a1d6..4b368b3ada9de1d1cf8daec76d29bedcd9a68509 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # section base class\r
 #\r
-#  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -20,6 +20,7 @@ from GenFdsGlobalVariable import GenFdsGlobalVariable
 import Common.LongFilePathOs as os, glob\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
+from Common.DataType import TAB_ARCH_COMMON\r
 \r
 ## section base class\r
 #\r
@@ -111,10 +112,7 @@ class Section (SectionClassObject):
     #   @retval tuple       (File list, boolean)\r
     #\r
     def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False):\r
-        if FileType in Section.SectFileType.keys() :\r
-            IsSect = True\r
-        else :\r
-            IsSect = False\r
+        IsSect = FileType in Section.SectFileType\r
 \r
         if FileExtension is not None:\r
             Suffix = FileExtension\r
@@ -128,7 +126,7 @@ class Section (SectionClassObject):
         FileList = []\r
         if FileType is not None:\r
             for File in FfsInf.BinFileList:\r
-                if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:\r
+                if File.Arch == TAB_ARCH_COMMON or FfsInf.CurrentArch == File.Arch:\r
                     if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \\r
                                                  and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX') \\r
                                                  or (FileType == 'TE'and File.Type == 'PE32'):\r