summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/GenFds/EfiSection.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-10-24 01:29:19 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-10-25 20:14:49 +0800
commit9e47e6f90880e090cd81f585abd7a6c553fbce10 (patch)
treec280e390d282db4c41d64718b366c1c3e64dc9ba /BaseTools/Source/Python/GenFds/EfiSection.py
parent0019375fbc89e4d7cfebe29e288b74731bd9f456 (diff)
downloadedk2-9e47e6f90880e090cd81f585abd7a6c553fbce10.tar.gz
edk2-9e47e6f90880e090cd81f585abd7a6c553fbce10.tar.bz2
edk2-9e47e6f90880e090cd81f585abd7a6c553fbce10.zip
BaseTools/GenFds: cleanup GenFds
1) remove wildcard imports and use explicit imports 2) refactor to use shared variables from Common/DataType 3) rename to not shadow imports 4) don't assign a variable in a loop (just do final assignment) 5) remove spaces, parens, unused or commented out code, etc. 6) merge unnecessary parent classes into child 7) refactor to share DXE and PEI apriori GUIDs from one place this includes changes to Build and EOT files 8) for PEP8, dont use __ for custom methods. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob C Feng <bob.c.feng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/EfiSection.py')
-rw-r--r--BaseTools/Source/Python/GenFds/EfiSection.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py
index 623b77d274..f8573b5c7d 100644
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ b/BaseTools/Source/Python/GenFds/EfiSection.py
@@ -20,7 +20,7 @@ from struct import *
from . import Section
from .GenFdsGlobalVariable import GenFdsGlobalVariable
import subprocess
-from .Ffs import Ffs
+from .Ffs import SectionSuffix
import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import EfiSectionClassObject
from Common import EdkLogger
@@ -124,7 +124,7 @@ class EfiSection (EfiSectionClassObject):
BuildNumTuple = tuple()
Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
#Ui=StringData,
Ver=BuildNum,
@@ -135,7 +135,7 @@ class EfiSection (EfiSectionClassObject):
for File in FileList:
Index = Index + 1
Num = '%s.%d' %(SecNum, Index)
- OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + SectionSuffix.get(SectionType))
f = open(File, 'r')
VerString = f.read()
f.close()
@@ -164,7 +164,7 @@ class EfiSection (EfiSectionClassObject):
else:
EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s miss Version Section value" %InfFileName)
Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
#Ui=VerString,
Ver=BuildNum,
@@ -185,7 +185,7 @@ class EfiSection (EfiSectionClassObject):
Num = SecNum
if IsMakefile and StringData == ModuleNameStr:
StringData = "$(MODULE_NAME)"
- OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',
Ui=StringData, IsMakefile=IsMakefile)
OutputFileList.append(OutputFile)
@@ -194,7 +194,7 @@ class EfiSection (EfiSectionClassObject):
for File in FileList:
Index = Index + 1
Num = '%s.%d' %(SecNum, Index)
- OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + SectionSuffix.get(SectionType))
f = open(File, 'r')
UiString = f.read()
f.close()
@@ -218,7 +218,7 @@ class EfiSection (EfiSectionClassObject):
Num = SecNum
if IsMakefile and StringData == ModuleNameStr:
StringData = "$(MODULE_NAME)"
- OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',
Ui=StringData, IsMakefile=IsMakefile)
OutputFileList.append(OutputFile)
@@ -239,7 +239,7 @@ class EfiSection (EfiSectionClassObject):
""" Copy Map file to FFS output path """
Index = Index + 1
Num = '%s.%d' %(SecNum, Index)
- OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))
+ OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + Num + SectionSuffix.get(SectionType))
File = GenFdsGlobalVariable.MacroExtend(File, Dict)
#Get PE Section alignment when align is set to AUTO