#\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
## GenTailCommentLines\r
#\r
# @param TailCommentLines: the tail comment lines that need to be generated\r
-# @param LeadingSpaceNum: the number of leading space needed for non-first \r
+# @param LeadingSpaceNum: the number of leading space needed for non-first\r
# line tail comment\r
-# \r
+#\r
def GenTailCommentLines (TailCommentLines, LeadingSpaceNum = 0):\r
TailCommentLines = TailCommentLines.rstrip(END_OF_LINE)\r
CommentStr = TAB_SPACE_SPLIT*2 + TAB_SPECIAL_COMMENT + TAB_SPACE_SPLIT + \\r
(END_OF_LINE + LeadingSpaceNum * TAB_SPACE_SPLIT + TAB_SPACE_SPLIT*2 + TAB_SPECIAL_COMMENT + \\r
TAB_SPACE_SPLIT).join(GetSplitValueList(TailCommentLines, END_OF_LINE))\r
- \r
+\r
return CommentStr\r
\r
## GenGenericComment\r
#\r
# @param CommentLines: Generic comment Text, maybe Multiple Lines\r
-# \r
+#\r
def GenGenericComment (CommentLines):\r
if not CommentLines:\r
return ''\r
# and for line with only <EOL>, '#\n' will be generated instead of '# \n'\r
#\r
# @param CommentLines: Generic comment Text, maybe Multiple Lines\r
-# @return CommentStr: Generated comment line \r
-# \r
+# @return CommentStr: Generated comment line\r
+#\r
def GenGenericCommentF (CommentLines, NumOfPound=1, IsPrompt=False, IsInfLibraryClass=False):\r
if not CommentLines:\r
return ''\r
CommentStr += TAB_COMMENT_SPLIT * NumOfPound + TAB_SPACE_SPLIT * 16 + Line + END_OF_LINE\r
else:\r
CommentStr += TAB_COMMENT_SPLIT * NumOfPound + TAB_SPACE_SPLIT + Line + END_OF_LINE\r
- \r
+\r
return CommentStr\r
\r
\r
#\r
# Generate Header comment sections\r
#\r
-# @param Abstract One line of abstract \r
+# @param Abstract One line of abstract\r
# @param Description multiple lines of Description\r
# @param Copyright possible multiple copyright lines\r
# @param License possible multiple license lines\r
#\r
# Convert special character to (c), (r) and (tm).\r
#\r
- if isinstance(Abstract, unicode):\r
- Abstract = ConvertSpecialUnicodes(Abstract)\r
- if isinstance(Description, unicode):\r
- Description = ConvertSpecialUnicodes(Description)\r
+ Abstract = ConvertSpecialUnicodes(Abstract)\r
+ Description = ConvertSpecialUnicodes(Description)\r
if IsBinaryHeader:\r
Content += CommChar * 2 + TAB_SPACE_SPLIT + TAB_BINARY_HEADER_COMMENT + '\r\n'\r
elif CommChar == TAB_COMMENT_EDK1_SPLIT:\r
Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\\r
(Description, '\n'))\r
Content += '\r\n' + CommChar + '\r\n'\r
- \r
+\r
#\r
- # There is no '#\n' line to separate multiple copyright lines in code base \r
+ # There is no '#\n' line to separate multiple copyright lines in code base\r
#\r
if Copyright:\r
Copyright = Copyright.rstrip('\r\n')\r
Content += CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList\\r
(License, '\n'))\r
Content += '\r\n' + CommChar + '\r\n'\r
- \r
+\r
if CommChar == TAB_COMMENT_EDK1_SPLIT:\r
Content += CommChar + TAB_SPACE_SPLIT + TAB_STAR + TAB_COMMENT_EDK1_END + '\r\n'\r
else:\r
Content += CommChar * 2 + '\r\n'\r
- \r
+\r
return Content\r
\r
\r
#\r
# @param Usage: Usage type\r
# @param TailCommentText: Comment text for tail comment\r
-# \r
+#\r
def GenInfPcdTailComment (Usage, TailCommentText):\r
if (Usage == ITEM_UNDEFINED) and (not TailCommentText):\r
return ''\r
- \r
+\r
CommentLine = TAB_SPACE_SPLIT.join([Usage, TailCommentText])\r
return GenTailCommentLines(CommentLine)\r
\r
#\r
# @param Usage: Usage type\r
# @param TailCommentText: Comment text for tail comment\r
-# \r
+#\r
def GenInfProtocolPPITailComment (Usage, Notify, TailCommentText):\r
if (not Notify) and (Usage == ITEM_UNDEFINED) and (not TailCommentText):\r
return ''\r
- \r
+\r
if Notify:\r
CommentLine = USAGE_ITEM_NOTIFY + " ## "\r
else:\r
CommentLine = ''\r
- \r
+\r
CommentLine += TAB_SPACE_SPLIT.join([Usage, TailCommentText])\r
return GenTailCommentLines(CommentLine)\r
\r
#\r
# @param Usage: Usage type\r
# @param TailCommentText: Comment text for tail comment\r
-# \r
+#\r
def GenInfGuidTailComment (Usage, GuidTypeList, VariableName, TailCommentText):\r
GuidType = GuidTypeList[0]\r
if (Usage == ITEM_UNDEFINED) and (GuidType == ITEM_UNDEFINED) and \\r
(not TailCommentText):\r
return ''\r
- \r
- FirstLine = Usage + " ## " + GuidType \r
+\r
+ FirstLine = Usage + " ## " + GuidType\r
if GuidType == TAB_INF_GUIDTYPE_VAR:\r
FirstLine += ":" + VariableName\r
- \r
+\r
CommentLine = TAB_SPACE_SPLIT.join([FirstLine, TailCommentText])\r
return GenTailCommentLines(CommentLine)\r
\r
## GenDecGuidTailComment\r
#\r
# @param SupModuleList: Supported module type list\r
-# \r
-def GenDecTailComment (SupModuleList): \r
+#\r
+def GenDecTailComment (SupModuleList):\r
CommentLine = TAB_SPACE_SPLIT.join(SupModuleList)\r
return GenTailCommentLines(CommentLine)\r
\r
\r
## _GetHelpStr\r
-# get HelpString from a list of HelpTextObject, the priority refer to \r
+# get HelpString from a list of HelpTextObject, the priority refer to\r
# related HLD\r
#\r
# @param HelpTextObjList: List of HelpTextObject\r
-# \r
+#\r
# @return HelpStr: the help text string found, '' means no help text found\r
#\r
def _GetHelpStr(HelpTextObjList):\r
- ValueList = [] \r
+ ValueList = []\r
for HelpObj in HelpTextObjList:\r
ValueList.append((HelpObj.GetLang(), HelpObj.GetString()))\r
return GetLocalValue(ValueList, True)\r