summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/GenMetaFile
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/GenMetaFile')
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py142
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py52
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py18
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py10
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/__init__.py10
5 files changed, 116 insertions, 116 deletions
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
index a1a9d38087..0ba07ccebc 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
@@ -4,9 +4,9 @@
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -70,7 +70,7 @@ from Library.StringUtils import GetUniFileName
def GenPcd(Package, Content):
#
# generate [Pcd] section
- # <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
+ # <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
#
ValidUsageDict = {}
for Pcd in Package.GetPcdList():
@@ -80,16 +80,16 @@ def GenPcd(Package, Content):
HelpTextList = Pcd.GetHelpTextList()
HelpStr = _GetHelpStr(HelpTextList)
CommentStr = GenGenericCommentF(HelpStr, 2)
-
+
PromptList = Pcd.GetPromptList()
PromptStr = _GetHelpStr(PromptList)
CommentStr += GenGenericCommentF(PromptStr.strip(), 1, True)
-
+
PcdErrList = Pcd.GetPcdErrorsList()
for PcdErr in PcdErrList:
CommentStr += GenPcdErrComment(PcdErr)
Statement = CommentStr
-
+
CName = Pcd.GetCName()
TokenSpaceGuidCName = Pcd.GetTokenSpaceGuidCName()
DefaultValue = Pcd.GetDefaultValue()
@@ -107,7 +107,7 @@ def GenPcd(Package, Content):
ValidUsage = 'PcdsDynamic'
elif ValidUsage == 'PcdEx':
ValidUsage = 'PcdsDynamicEx'
-
+
if ValidUsage in ValidUsageDict:
NewSectionDict = ValidUsageDict[ValidUsage]
else:
@@ -129,17 +129,17 @@ def GenPcd(Package, Content):
NewSectionDict[SortedArch] = \
NewSectionDict[SortedArch] + [Statement]
else:
- NewSectionDict[SortedArch] = [Statement]
-
+ NewSectionDict[SortedArch] = [Statement]
+
for ValidUsage in ValidUsageDict:
Content += GenSection(ValidUsage, ValidUsageDict[ValidUsage], True, True)
-
+
return Content
def GenPcdErrorMsgSection(Package, Content):
if not Package.PcdErrorCommentDict:
return Content
-
+
#
# Generate '# [Error.<TokenSpcCName>]' section
#
@@ -148,14 +148,14 @@ def GenPcdErrorMsgSection(Package, Content):
SectionComment += TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_ERROR_SECTION_COMMENT + END_OF_LINE
SectionComment += TAB_COMMENT_SPLIT + END_OF_LINE
TokenSpcCNameList = []
-
+
#
# Get TokenSpcCName list in PcdErrorCommentDict in Package object
#
for (TokenSpcCName, ErrorNumber) in Package.PcdErrorCommentDict:
if TokenSpcCName not in TokenSpcCNameList:
TokenSpcCNameList.append(TokenSpcCName)
-
+
for TokenSpcCNameItem in TokenSpcCNameList:
SectionName = TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_SECTION_START + TAB_PCD_ERROR + \
TAB_SPLIT + TokenSpcCNameItem + TAB_SECTION_END + END_OF_LINE
@@ -168,10 +168,10 @@ def GenPcdErrorMsgSection(Package, Content):
ErrorNumber + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT + TAB_SPACE_SPLIT + \
PcdErrorMsg + END_OF_LINE
Content += SectionItem
-
+
Content += TAB_COMMENT_SPLIT
return Content
-
+
def GenGuidProtocolPpi(Package, Content):
#
# generate [Guids] section
@@ -203,17 +203,17 @@ def GenGuidProtocolPpi(Package, Content):
# generate tail comment
#
if Guid.GetSupModuleList():
- Statement += GenDecTailComment(Guid.GetSupModuleList())
+ Statement += GenDecTailComment(Guid.GetSupModuleList())
ArchList = sorted(Guid.GetSupArchList())
SortedArch = ' '.join(ArchList)
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
NewSectionDict[SortedArch] + [Statement]
else:
- NewSectionDict[SortedArch] = [Statement]
+ NewSectionDict[SortedArch] = [Statement]
Content += GenSection('Guids', NewSectionDict, True, True)
-
+
#
# generate [Protocols] section
#
@@ -232,9 +232,9 @@ def GenGuidProtocolPpi(Package, Content):
#
HelpTextList = Protocol.GetHelpTextList()
HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr, 2)
+ CommentStr = GenGenericCommentF(HelpStr, 2)
- Statement = CommentStr
+ Statement = CommentStr
CName = Protocol.GetCName()
Value = GuidStringToGuidStructureString(Protocol.GetGuid())
Statement += CName.ljust(LeftOffset) + ' = ' + Value
@@ -250,9 +250,9 @@ def GenGuidProtocolPpi(Package, Content):
NewSectionDict[SortedArch] = \
NewSectionDict[SortedArch] + [Statement]
else:
- NewSectionDict[SortedArch] = [Statement]
+ NewSectionDict[SortedArch] = [Statement]
- Content += GenSection('Protocols', NewSectionDict, True, True)
+ Content += GenSection('Protocols', NewSectionDict, True, True)
#
# generate [Ppis] section
@@ -290,28 +290,28 @@ def GenGuidProtocolPpi(Package, Content):
NewSectionDict[SortedArch] = \
NewSectionDict[SortedArch] + [Statement]
else:
- NewSectionDict[SortedArch] = [Statement]
+ NewSectionDict[SortedArch] = [Statement]
Content += GenSection('Ppis', NewSectionDict, True, True)
-
+
return Content
## Transfer Package Object to Dec files
#
-# Transfer all contents of a standard Package Object to a Dec file
+# Transfer all contents of a standard Package Object to a Dec file
#
-# @param Package: A Package
+# @param Package: A Package
#
def PackageToDec(Package, DistHeader = None):
#
# Init global information for the file
#
ContainerFile = Package.GetFullPath()
-
+
Content = ''
-
+
#
- # Generate file header
+ # Generate file header
#
PackageAbstract = GetLocalValue(Package.GetAbstract())
PackageDescription = GetLocalValue(Package.GetDescription())
@@ -335,7 +335,7 @@ def PackageToDec(Package, DistHeader = None):
if not PackageLicense and DistHeader:
for (Lang, License) in DistHeader.GetLicense():
PackageLicense = License
-
+
#
# Generate header comment section of DEC file
#
@@ -345,7 +345,7 @@ def PackageToDec(Package, DistHeader = None):
PackageLicense).replace('\r\n', '\n')
#
- # Generate Binary header
+ # Generate Binary header
#
for UserExtension in Package.GetUserExtensionList():
if UserExtension.GetUserID() == TAB_BINARY_HEADER_USERID \
@@ -357,12 +357,12 @@ def PackageToDec(Package, DistHeader = None):
for (Lang, Copyright) in UserExtension.GetBinaryCopyright():
PackageBinaryCopyright = Copyright
for (Lang, License) in UserExtension.GetBinaryLicense():
- PackageBinaryLicense = License
+ PackageBinaryLicense = License
if PackageBinaryAbstract and PackageBinaryDescription and \
PackageBinaryCopyright and PackageBinaryLicense:
- Content += GenHeaderCommentSection(PackageBinaryAbstract,
- PackageBinaryDescription,
- PackageBinaryCopyright,
+ Content += GenHeaderCommentSection(PackageBinaryAbstract,
+ PackageBinaryDescription,
+ PackageBinaryCopyright,
PackageBinaryLicense,
True)
@@ -374,23 +374,23 @@ def PackageToDec(Package, DistHeader = None):
GenPackageUNIEncodeFile(Package, FileHeader)
#
- # for each section, maintain a dict, sorted arch will be its key,
+ # for each section, maintain a dict, sorted arch will be its key,
#statement list will be its data
# { 'Arch1 Arch2 Arch3': [statement1, statement2],
- # 'Arch1' : [statement1, statement3]
+ # 'Arch1' : [statement1, statement3]
# }
#
-
+
#
- # generate [Defines] section
+ # generate [Defines] section
#
LeftOffset = 31
NewSectionDict = {TAB_ARCH_COMMON : []}
SpecialItemList = []
-
+
Statement = (u'%s ' % TAB_DEC_DEFINES_DEC_SPECIFICATION).ljust(LeftOffset) + u'= %s' % '0x00010017'
SpecialItemList.append(Statement)
-
+
BaseName = Package.GetBaseName()
if BaseName.startswith('.') or BaseName.startswith('-'):
BaseName = '_' + BaseName
@@ -405,7 +405,7 @@ def PackageToDec(Package, DistHeader = None):
if Package.UNIFlag:
Statement = (u'%s ' % TAB_DEC_DEFINES_PKG_UNI_FILE).ljust(LeftOffset) + u'= %s' % Package.GetBaseName() + '.uni'
- SpecialItemList.append(Statement)
+ SpecialItemList.append(Statement)
for SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
@@ -417,7 +417,7 @@ def PackageToDec(Package, DistHeader = None):
#
NewSectionDict = {}
IncludeArchList = Package.GetIncludeArchList()
- if IncludeArchList:
+ if IncludeArchList:
for Path, ArchList in IncludeArchList:
Statement = Path
ArchList.sort()
@@ -465,7 +465,7 @@ def PackageToDec(Package, DistHeader = None):
NewSectionDict[SortedArch] = \
NewSectionDict[SortedArch] + [Statement]
else:
- NewSectionDict[SortedArch] = [Statement]
+ NewSectionDict[SortedArch] = [Statement]
Content += GenSection('LibraryClasses', NewSectionDict, True, True)
@@ -473,7 +473,7 @@ def PackageToDec(Package, DistHeader = None):
# Generate '# [Error.<TokenSpcCName>]' section
#
Content = GenPcdErrorMsgSection(Package, Content)
-
+
Content = GenPcd(Package, Content)
#
@@ -498,7 +498,7 @@ def PackageToDec(Package, DistHeader = None):
NewStatement = ""
for Line in LineList:
NewStatement += " %s\n" % Line
-
+
SectionList = []
SectionName = 'UserExtensions'
UserId = UserExtension.GetUserID()
@@ -533,7 +533,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
BinaryAbstract = []
BinaryDescription = []
#
- # If more than one language code is used for any element that would be present in the PACKAGE_UNI_FILE,
+ # If more than one language code is used for any element that would be present in the PACKAGE_UNI_FILE,
# then the PACKAGE_UNI_FILE must be created.
#
for (Key, Value) in PackageObject.GetAbstract() + PackageObject.GetDescription():
@@ -541,7 +541,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
GenUNIFlag = True
else:
OnlyLANGUAGE_EN_X = False
-
+
for UserExtension in PackageObject.GetUserExtensionList():
if UserExtension.GetUserID() == TAB_BINARY_HEADER_USERID \
and UserExtension.GetIdentifier() == TAB_BINARY_HEADER_IDENTIFIER:
@@ -565,7 +565,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
GenUNIFlag = True
else:
OnlyLANGUAGE_EN_X = False
-
+
for PcdError in Pcd.GetPcdErrorsList():
if PcdError.GetErrorNumber().startswith('0x') or PcdError.GetErrorNumber().startswith('0X'):
for (Key, Value) in PcdError.GetErrorMessageList():
@@ -579,26 +579,26 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
return
else:
PackageObject.UNIFlag = True
-
+
if not os.path.exists(os.path.dirname(PackageObject.GetFullPath())):
os.makedirs(os.path.dirname(PackageObject.GetFullPath()))
-
+
ContainerFile = GetUniFileName(os.path.dirname(PackageObject.GetFullPath()), PackageObject.GetBaseName())
Content = UniFileHeader + '\r\n'
Content += '\r\n'
-
+
Content += FormatUniEntry('#string ' + TAB_DEC_PACKAGE_ABSTRACT, PackageObject.GetAbstract(), ContainerFile) + '\r\n'
-
+
Content += FormatUniEntry('#string ' + TAB_DEC_PACKAGE_DESCRIPTION, PackageObject.GetDescription(), ContainerFile) \
+ '\r\n'
-
+
Content += FormatUniEntry('#string ' + TAB_DEC_BINARY_ABSTRACT, BinaryAbstract, ContainerFile) + '\r\n'
-
+
Content += FormatUniEntry('#string ' + TAB_DEC_BINARY_DESCRIPTION, BinaryDescription, ContainerFile) + '\r\n'
-
+
PromptGenList = []
- HelpTextGenList = []
+ HelpTextGenList = []
for Pcd in PackageObject.GetPcdList():
# Generate Prompt for each Pcd
PcdPromptStrName = '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCName() + '_' + Pcd.GetCName() + '_PROMPT '
@@ -607,7 +607,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
Lang = TxtObj.GetLang()
PromptStr = TxtObj.GetString()
#
- # Avoid generating the same PROMPT entry more than one time.
+ # Avoid generating the same PROMPT entry more than one time.
#
if (PcdPromptStrName, Lang) not in PromptGenList:
TokenValueList.append((Lang, PromptStr))
@@ -615,7 +615,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
PromptString = FormatUniEntry(PcdPromptStrName, TokenValueList, ContainerFile) + '\r\n'
if PromptString not in Content:
Content += PromptString
-
+
# Generate Help String for each Pcd
PcdHelpStrName = '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCName() + '_' + Pcd.GetCName() + '_HELP '
TokenValueList = []
@@ -623,7 +623,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
Lang = TxtObj.GetLang()
HelpStr = TxtObj.GetString()
#
- # Avoid generating the same HELP entry more than one time.
+ # Avoid generating the same HELP entry more than one time.
#
if (PcdHelpStrName, Lang) not in HelpTextGenList:
TokenValueList.append((Lang, HelpStr))
@@ -631,7 +631,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
HelpTextString = FormatUniEntry(PcdHelpStrName, TokenValueList, ContainerFile) + '\r\n'
if HelpTextString not in Content:
Content += HelpTextString
-
+
# Generate PcdError for each Pcd if ErrorNo exist.
for PcdError in Pcd.GetPcdErrorsList():
ErrorNo = PcdError.GetErrorNumber()
@@ -642,7 +642,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
PcdErrString = FormatUniEntry(PcdErrStrName, PcdError.GetErrorMessageList(), ContainerFile) + '\r\n'
if PcdErrString not in Content:
Content += PcdErrString
-
+
File = codecs.open(ContainerFile, 'w', Encoding)
File.write(u'\uFEFF' + Content)
File.stream.close()
@@ -652,23 +652,23 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
PackageObject.FileList.append((ContainerFile, Md5Sum))
return ContainerFile
-
+
## GenPcdErrComment
#
# @param PcdErrObject: PcdErrorObject
-#
+#
# @retval CommentStr: Generated comment lines, with prefix "#"
-#
+#
def GenPcdErrComment (PcdErrObject):
- CommentStr = ''
+ CommentStr = ''
ErrorCode = PcdErrObject.GetErrorNumber()
ValidValueRange = PcdErrObject.GetValidValueRange()
if ValidValueRange:
- CommentStr = TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_VALIDRANGE + TAB_SPACE_SPLIT
+ CommentStr = TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_VALIDRANGE + TAB_SPACE_SPLIT
if ErrorCode:
CommentStr += ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT + TAB_SPACE_SPLIT
CommentStr += ValidValueRange + END_OF_LINE
-
+
ValidValue = PcdErrObject.GetValidValue()
if ValidValue:
ValidValueList = \
@@ -677,13 +677,13 @@ def GenPcdErrComment (PcdErrObject):
if ErrorCode:
CommentStr += ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT + TAB_SPACE_SPLIT
CommentStr += TAB_COMMA_SPLIT.join(ValidValueList) + END_OF_LINE
-
+
Expression = PcdErrObject.GetExpression()
if Expression:
CommentStr = TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_EXPRESSION + TAB_SPACE_SPLIT
if ErrorCode:
CommentStr += ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT + TAB_SPACE_SPLIT
CommentStr += Expression + END_OF_LINE
-
+
return CommentStr
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
index 9457f851f4..b62c705137 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
@@ -4,9 +4,9 @@
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -46,8 +46,8 @@ from Library.StringUtils import GetUniFileName
## Transfer Module Object to Inf files
#
-# Transfer all contents of a standard Module Object to an Inf file
-# @param ModuleObject: A Module Object
+# Transfer all contents of a standard Module Object to an Inf file
+# @param ModuleObject: A Module Object
#
def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):
if not GlobalData.gWSPKG_LIST:
@@ -59,9 +59,9 @@ def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):
Content = ''
#
- # Generate file header, If any Abstract, Description, Copyright or License XML elements are missing,
- # should 1) use the Abstract, Description, Copyright or License from the PackageSurfaceArea.Header elements
- # that the module belongs to, or 2) if this is a stand-alone module that is not included in a PackageSurfaceArea,
+ # Generate file header, If any Abstract, Description, Copyright or License XML elements are missing,
+ # should 1) use the Abstract, Description, Copyright or License from the PackageSurfaceArea.Header elements
+ # that the module belongs to, or 2) if this is a stand-alone module that is not included in a PackageSurfaceArea,
# use the abstract, description, copyright or license from the DistributionPackage.Header elements.
#
ModuleAbstract = GetLocalValue(ModuleObject.GetAbstract())
@@ -107,15 +107,15 @@ def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):
#
# Generate header comment section of INF file
- #
+ #
Content += GenHeaderCommentSection(ModuleAbstract,
ModuleDescription,
ModuleCopyright,
ModuleLicense).replace('\r\n', '\n')
#
- # Generate Binary Header
- #
+ # Generate Binary Header
+ #
for UserExtension in ModuleObject.GetUserExtensionList():
if UserExtension.GetUserID() == DT.TAB_BINARY_HEADER_USERID \
and UserExtension.GetIdentifier() == DT.TAB_BINARY_HEADER_IDENTIFIER:
@@ -152,10 +152,10 @@ def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):
else:
GlobalData.gIS_BINARY_INF = False
#
- # for each section, maintain a dict, sorted arch will be its key,
+ # for each section, maintain a dict, sorted arch will be its key,
# statement list will be its data
# { 'Arch1 Arch2 Arch3': [statement1, statement2],
- # 'Arch1' : [statement1, statement3]
+ # 'Arch1' : [statement1, statement3]
# }
#
# Gen section contents
@@ -197,7 +197,7 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD
BinaryAbstract = []
BinaryDescription = []
#
- # If more than one language code is used for any element that would be present in the MODULE_UNI_FILE,
+ # If more than one language code is used for any element that would be present in the MODULE_UNI_FILE,
# then the MODULE_UNI_FILE must be created.
#
for (Key, Value) in ModuleObject.GetAbstract() + ModuleObject.GetDescription():
@@ -300,11 +300,11 @@ def GenDefines(ModuleObject):
BaseName = '_' + BaseName
Statement = (u'%s ' % DT.TAB_INF_DEFINES_BASE_NAME).ljust(LeftOffset) + u'= %s' % BaseName
SpecialStatementList.append(Statement)
-
+
# TAB_INF_DEFINES_FILE_GUID
Statement = (u'%s ' % DT.TAB_INF_DEFINES_FILE_GUID).ljust(LeftOffset) + u'= %s' % ModuleObject.GetGuid()
SpecialStatementList.append(Statement)
-
+
# TAB_INF_DEFINES_VERSION_STRING
Statement = (u'%s ' % DT.TAB_INF_DEFINES_VERSION_STRING).ljust(LeftOffset) + u'= %s' % ModuleObject.GetVersion()
SpecialStatementList.append(Statement)
@@ -480,7 +480,7 @@ def GenPackages(ModuleObject):
Path = ''
#
# find package path/name
- #
+ #
for PkgInfo in GlobalData.gWSPKG_LIST:
if Guid == PkgInfo[1]:
if (not Version) or (Version == PkgInfo[2]):
@@ -553,7 +553,7 @@ def GenDepex(ModuleObject):
else:
NewSectionDict[Key] = [Statement]
Content += GenSection('Depex', NewSectionDict, False)
-
+
return Content
## GenUserExtensions
#
@@ -673,7 +673,7 @@ def GenBinaryStatement(Key, Value, SubTypeGuidValue=None):
Statement += '|' + Target
return Statement
## GenGuidSections
-#
+#
# @param GuidObjList: List of GuidObject
# @retVal Content: The generated section contents
#
@@ -736,7 +736,7 @@ def GenGuidSections(GuidObjList):
return Content
## GenProtocolPPiSections
-#
+#
# @param ObjList: List of ProtocolObject or Ppi Object
# @retVal Content: The generated section contents
#
@@ -804,7 +804,7 @@ def GenPcdSections(ModuleObject):
Content = ''
if not GlobalData.gIS_BINARY_INF:
#
- # for each Pcd Itemtype, maintain a dict so the same type will be grouped
+ # for each Pcd Itemtype, maintain a dict so the same type will be grouped
# together
#
ItemTypeDict = {}
@@ -866,7 +866,7 @@ def GenPcdSections(ModuleObject):
if NewSectionDict:
Content += GenSection(ItemType, NewSectionDict)
#
- # For AsBuild INF files
+ # For AsBuild INF files
#
else:
Content += GenAsBuiltPacthPcdSections(ModuleObject)
@@ -905,7 +905,7 @@ def GenAsBuiltPacthPcdSections(ModuleObject):
Statement = HelpString + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue + ' | ' + \
PcdOffset + DT.TAB_SPACE_SPLIT
#
- # Use binary file's Arch to be Pcd's Arch
+ # Use binary file's Arch to be Pcd's Arch
#
ArchList = []
FileNameObjList = BinaryFile.GetFileNameList()
@@ -954,7 +954,7 @@ def GenAsBuiltPcdExSections(ModuleObject):
Statement = HelpString + TokenSpaceName + DT.TAB_SPLIT + PcdCName + DT.TAB_SPACE_SPLIT
#
- # Use binary file's Arch to be Pcd's Arch
+ # Use binary file's Arch to be Pcd's Arch
#
ArchList = []
FileNameObjList = BinaryFile.GetFileNameList()
@@ -1033,7 +1033,7 @@ def GenSpecialSections(ObjectList, SectionName, UserExtensionsContent=''):
Content = Content.lstrip()
#
# add a return to differentiate it between other possible sections
- #
+ #
if Content:
Content += '\n'
return Content
@@ -1110,7 +1110,7 @@ def GenBinaries(ModuleObject):
else:
NewSectionDict[SortedArch] = [Statement]
#
- # as we already generated statement for this DictKey here set the Valuelist to be empty
+ # as we already generated statement for this DictKey here set the Valuelist to be empty
# to avoid generate duplicate entries as the DictKey may have multiple entries
#
BinariesDict[Key] = []
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py
index ae8dc85e3e..da3972ccc3 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py
@@ -2,11 +2,11 @@
#
# This file contained the miscellaneous routines for GenMetaFile usage.
#
-# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -26,7 +26,7 @@ from Parser.DecParser import Dec
# @param SectionDict: string of source file path/name
# @param Arch: string of source file family field
# @param ExternList: string of source file FeatureFlag field
-#
+#
def AddExternToDefineSec(SectionDict, Arch, ExternList):
LeftOffset = 31
for ArchList, EntryPoint, UnloadImage, Constructor, Destructor, FFE, HelpStringList in ExternList:
@@ -93,7 +93,7 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):
Path = None
#
# find package path/name
- #
+ #
for PkgInfo in GlobalData.gWSPKG_LIST:
if Guid == PkgInfo[1]:
if (not Version) or (Version == PkgInfo[2]):
@@ -156,9 +156,9 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):
return TokenSpaceGuidName, PcdCName
## _TransferDict
-# transfer dict that using (Statement, SortedArch) as key,
+# transfer dict that using (Statement, SortedArch) as key,
# (GenericComment, UsageComment) as value into a dict that using SortedArch as
-# key and NewStatement as value
+# key and NewStatement as value
#
def TransferDict(OrigDict, Type=None):
NewDict = {}
@@ -171,7 +171,7 @@ def TransferDict(OrigDict, Type=None):
for Statement, SortedArch in OrigDict:
if len(Statement) > LeftOffset:
LeftOffset = len(Statement)
-
+
for Statement, SortedArch in OrigDict:
Comment = OrigDict[Statement, SortedArch]
#
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
index b1f427723c..3376091367 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
@@ -2,11 +2,11 @@
#
# This file contained the logical of generate XML files.
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -15,4 +15,4 @@
'''
GenXmlFile
-''' \ No newline at end of file
+'''
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py b/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
index 269ba0bc48..bf0b3bc07c 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
@@ -4,11 +4,11 @@
# This file is required to make Python interpreter treat the directory
# as containing package.
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@@ -17,4 +17,4 @@
'''
GenMetaFile
-''' \ No newline at end of file
+'''