]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Parser/InfSectionParser.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Parser / InfSectionParser.py
index 8ba4c3fc0819265a5d11b4abc395322a5ef3051d..1f254058d1332685891585017ae8289dc030bd3f 100644 (file)
@@ -1,11 +1,11 @@
 ## @file\r
-# This file contained the parser for sections in INF file \r
+# This file contained the parser for sections in INF file\r
 #\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
@@ -95,7 +95,7 @@ def GetSpecialStr2(ItemList, FileName, LineNo, SectionString):
             if ItemList[3] != '':\r
                 Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_INVALID \\r
                              % (SectionString), File=FileName, Line=LineNo, ExtraData=SectionString)\r
-        \r
+\r
         if not ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper():\r
             Str2 = ItemList[2] + ' | ' + ItemList[3]\r
         else:\r
@@ -108,7 +108,7 @@ def GetSpecialStr2(ItemList, FileName, LineNo, SectionString):
     return Str2\r
 \r
 ## ProcessUseExtHeader\r
-# \r
+#\r
 #\r
 def ProcessUseExtHeader(ItemList):\r
     NewItemList = []\r
@@ -138,12 +138,12 @@ def ProcessUseExtHeader(ItemList):
                 NewItemList.append(Item)\r
             else:\r
                 AppendContent = AppendContent + "." + Item\r
-    \r
+\r
     if len(NewItemList) > 4:\r
         return False, []\r
-    \r
+\r
     return True, NewItemList\r
-  \r
+\r
 ## GetArch\r
 #\r
 # GetArch\r
@@ -244,7 +244,7 @@ class InfSectionParser(InfDefinSectionParser,
 \r
         #\r
         # A List for store define section content.\r
-        #    \r
+        #\r
         self._PcdNameList = []\r
         self._SectionName = ''\r
         self._SectionType = 0\r
@@ -253,7 +253,7 @@ class InfSectionParser(InfDefinSectionParser,
 \r
     #\r
     # File Header content parser\r
-    #    \r
+    #\r
     def InfHeaderParser(self, Content, InfHeaderObject2, FileName, IsBinaryHeader = False):\r
         if IsBinaryHeader:\r
             (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName, True)\r
@@ -272,7 +272,7 @@ class InfSectionParser(InfDefinSectionParser,
 \r
         #\r
         # Insert Abstract, Description, CopyRight, License into header object\r
-        #                                \r
+        #\r
         InfHeaderObject2.SetAbstract(Abstract)\r
         InfHeaderObject2.SetDescription(Description)\r
         InfHeaderObject2.SetCopyright(Copyright)\r
@@ -287,7 +287,7 @@ class InfSectionParser(InfDefinSectionParser,
     #\r
     #       [section_name.arch<.platform|module_type>]\r
     #\r
-    # @param String    A string contained the content need to be parsed. \r
+    # @param String    A string contained the content need to be parsed.\r
     #\r
     def SectionHeaderParser(self, SectionString, FileName, LineNo):\r
         _Scope = []\r
@@ -313,7 +313,7 @@ class InfSectionParser(InfDefinSectionParser,
             #\r
             # different section should not mix in one section\r
             # Allow different PCD type sections mixed together\r
-            # \r
+            #\r
             if _SectionName.upper() not in _PcdNameList:\r
                 if _SectionName != '' and _SectionName.upper() != ItemList[0].upper():\r
                     Logger.Error('Parser',\r
@@ -350,7 +350,7 @@ class InfSectionParser(InfDefinSectionParser,
 \r
             #\r
             # For [Defines] section, do special check.\r
-            # \r
+            #\r
             if ItemList[0].upper() == DT.TAB_COMMON_DEFINES.upper():\r
                 if len(ItemList) != 1:\r
                     Logger.Error('Parser',\r
@@ -360,26 +360,26 @@ class InfSectionParser(InfDefinSectionParser,
 \r
             #\r
             # For [UserExtension] section, do special check.\r
-            # \r
+            #\r
             if ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper():\r
-            \r
+\r
                 RetValue = ProcessUseExtHeader(ItemList)\r
-                \r
+\r
                 if not RetValue[0]:\r
                     Logger.Error('Parser',\r
                                  FORMAT_INVALID,\r
                                  ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (SectionString),\r
                                  File=FileName, Line=LineNo, ExtraData=SectionString)\r
                 else:\r
-                    ItemList = RetValue[1]              \r
-                \r
+                    ItemList = RetValue[1]\r
+\r
                 if len(ItemList) == 3:\r
                     ItemList.append('COMMON')\r
-                \r
+\r
                 Str1 = ItemList[1]\r
 \r
             #\r
-            # For Library classes, need to check module type.       \r
+            # For Library classes, need to check module type.\r
             #\r
             if ItemList[0].upper() == DT.TAB_LIBRARY_CLASSES.upper() and len(ItemList) == 3:\r
                 if ItemList[2] != '':\r
@@ -424,10 +424,10 @@ class InfSectionParser(InfDefinSectionParser,
 \r
     ## GenSpecialSectionList\r
     #\r
-    #  @param SpecialSectionList: a list of list, of which item's format \r
+    #  @param SpecialSectionList: a list of list, of which item's format\r
     #                             (Comment, LineNum)\r
     #  @param ContainerFile:      Input value for filename of Inf file\r
-    # \r
+    #\r
     def InfSpecialCommentParser (self, SpecialSectionList, InfSectionObject, ContainerFile, SectionType):\r
         ReFindSpecialCommentRe = re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)\r
         ReFindHobArchRe = re.compile(r"""[Hh][Oo][Bb]\.([^,]*)""", re.DOTALL)\r