#\r
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
\r
## Transfer Module Object to Inf files\r
#\r
-# Transfer all contents of a standard Module Object to an Inf file \r
-# @param ModuleObject: A Module Object \r
+# Transfer all contents of a standard Module Object to an Inf file\r
+# @param ModuleObject: A Module Object\r
#\r
def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):\r
if not GlobalData.gWSPKG_LIST:\r
\r
Content = ''\r
#\r
- # Generate file header, If any Abstract, Description, Copyright or License XML elements are missing, \r
- # should 1) use the Abstract, Description, Copyright or License from the PackageSurfaceArea.Header elements \r
- # that the module belongs to, or 2) if this is a stand-alone module that is not included in a PackageSurfaceArea, \r
+ # Generate file header, If any Abstract, Description, Copyright or License XML elements are missing,\r
+ # should 1) use the Abstract, Description, Copyright or License from the PackageSurfaceArea.Header elements\r
+ # that the module belongs to, or 2) if this is a stand-alone module that is not included in a PackageSurfaceArea,\r
# use the abstract, description, copyright or license from the DistributionPackage.Header elements.\r
#\r
ModuleAbstract = GetLocalValue(ModuleObject.GetAbstract())\r
\r
#\r
# Generate header comment section of INF file\r
- # \r
+ #\r
Content += GenHeaderCommentSection(ModuleAbstract,\r
ModuleDescription,\r
ModuleCopyright,\r
ModuleLicense).replace('\r\n', '\n')\r
\r
#\r
- # Generate Binary Header \r
- # \r
+ # Generate Binary Header\r
+ #\r
for UserExtension in ModuleObject.GetUserExtensionList():\r
if UserExtension.GetUserID() == DT.TAB_BINARY_HEADER_USERID \\r
and UserExtension.GetIdentifier() == DT.TAB_BINARY_HEADER_IDENTIFIER:\r
else:\r
GlobalData.gIS_BINARY_INF = False\r
#\r
- # for each section, maintain a dict, sorted arch will be its key, \r
+ # for each section, maintain a dict, sorted arch will be its key,\r
# statement list will be its data\r
# { 'Arch1 Arch2 Arch3': [statement1, statement2],\r
- # 'Arch1' : [statement1, statement3] \r
+ # 'Arch1' : [statement1, statement3]\r
# }\r
#\r
# Gen section contents\r
BinaryAbstract = []\r
BinaryDescription = []\r
#\r
- # If more than one language code is used for any element that would be present in the MODULE_UNI_FILE, \r
+ # If more than one language code is used for any element that would be present in the MODULE_UNI_FILE,\r
# then the MODULE_UNI_FILE must be created.\r
#\r
for (Key, Value) in ModuleObject.GetAbstract() + ModuleObject.GetDescription():\r
BaseName = '_' + BaseName\r
Statement = (u'%s ' % DT.TAB_INF_DEFINES_BASE_NAME).ljust(LeftOffset) + u'= %s' % BaseName\r
SpecialStatementList.append(Statement)\r
- \r
+\r
# TAB_INF_DEFINES_FILE_GUID\r
Statement = (u'%s ' % DT.TAB_INF_DEFINES_FILE_GUID).ljust(LeftOffset) + u'= %s' % ModuleObject.GetGuid()\r
SpecialStatementList.append(Statement)\r
- \r
+\r
# TAB_INF_DEFINES_VERSION_STRING\r
Statement = (u'%s ' % DT.TAB_INF_DEFINES_VERSION_STRING).ljust(LeftOffset) + u'= %s' % ModuleObject.GetVersion()\r
SpecialStatementList.append(Statement)\r
Path = ''\r
#\r
# find package path/name\r
- # \r
+ #\r
for PkgInfo in GlobalData.gWSPKG_LIST:\r
if Guid == PkgInfo[1]:\r
if (not Version) or (Version == PkgInfo[2]):\r
else:\r
NewSectionDict[Key] = [Statement]\r
Content += GenSection('Depex', NewSectionDict, False)\r
- \r
+\r
return Content\r
## GenUserExtensions\r
#\r
Statement += '|' + Target\r
return Statement\r
## GenGuidSections\r
-# \r
+#\r
# @param GuidObjList: List of GuidObject\r
# @retVal Content: The generated section contents\r
#\r
return Content\r
\r
## GenProtocolPPiSections\r
-# \r
+#\r
# @param ObjList: List of ProtocolObject or Ppi Object\r
# @retVal Content: The generated section contents\r
#\r
Content = ''\r
if not GlobalData.gIS_BINARY_INF:\r
#\r
- # for each Pcd Itemtype, maintain a dict so the same type will be grouped \r
+ # for each Pcd Itemtype, maintain a dict so the same type will be grouped\r
# together\r
#\r
ItemTypeDict = {}\r
if NewSectionDict:\r
Content += GenSection(ItemType, NewSectionDict)\r
#\r
- # For AsBuild INF files \r
+ # For AsBuild INF files\r
#\r
else:\r
Content += GenAsBuiltPacthPcdSections(ModuleObject)\r
Statement = HelpString + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue + ' | ' + \\r
PcdOffset + DT.TAB_SPACE_SPLIT\r
#\r
- # Use binary file's Arch to be Pcd's Arch \r
+ # Use binary file's Arch to be Pcd's Arch\r
#\r
ArchList = []\r
FileNameObjList = BinaryFile.GetFileNameList()\r
Statement = HelpString + TokenSpaceName + DT.TAB_SPLIT + PcdCName + DT.TAB_SPACE_SPLIT\r
\r
#\r
- # Use binary file's Arch to be Pcd's Arch \r
+ # Use binary file's Arch to be Pcd's Arch\r
#\r
ArchList = []\r
FileNameObjList = BinaryFile.GetFileNameList()\r
Content = Content.lstrip()\r
#\r
# add a return to differentiate it between other possible sections\r
- # \r
+ #\r
if Content:\r
Content += '\n'\r
return Content\r
else:\r
NewSectionDict[SortedArch] = [Statement]\r
#\r
- # as we already generated statement for this DictKey here set the Valuelist to be empty \r
+ # as we already generated statement for this DictKey here set the Valuelist to be empty\r
# to avoid generate duplicate entries as the DictKey may have multiple entries\r
#\r
BinariesDict[Key] = []\r