]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Library/CommentGenerating.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Library / CommentGenerating.py
index ab1725ff0ef249a2a888d28d20e22aac2c71a92f..4726629695803cfa2ef115486a3b43dc49bfe452 100644 (file)
@@ -3,9 +3,9 @@
 #\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
@@ -39,21 +39,21 @@ from Library.Misc import GetLocalValue
 ## 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
@@ -68,8 +68,8 @@ def GenGenericComment (CommentLines):
 #  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
@@ -104,7 +104,7 @@ def GenGenericCommentF (CommentLines, NumOfPound=1, IsPrompt=False, IsInfLibrary
                     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
@@ -112,7 +112,7 @@ def GenGenericCommentF (CommentLines, NumOfPound=1, IsPrompt=False, IsInfLibrary
 #\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
@@ -148,9 +148,9 @@ def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsBinaryH
         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
@@ -163,12 +163,12 @@ def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsBinaryH
         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
@@ -177,11 +177,11 @@ def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsBinaryH
 #\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
@@ -190,16 +190,16 @@ def GenInfPcdTailComment (Usage, TailCommentText):
 #\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
@@ -208,39 +208,39 @@ def GenInfProtocolPPITailComment (Usage, Notify, TailCommentText):
 #\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