]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Object / Parser / InfLibraryClassesObject.py
index b18c4c381bc0d763d2dc01d9820e708e6a720c03..2e56028318a18428b603c42dd5e8230595d77013 100644 (file)
@@ -1,16 +1,10 @@
 ## @file\r
-# This file is used to define class objects of INF file [LibraryClasses] section. \r
-# It will consumed by InfParser. \r
+# This file is used to define class objects of INF file [LibraryClasses] section.\r
+# It will consumed by InfParser.\r
 #\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\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
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 '''\r
 InfLibraryClassesObject\r
@@ -37,11 +31,11 @@ def GetArchModuleType(KeyList):
     for (ArchItem, ModuleItem) in KeyList:\r
         #\r
         # Validate Arch\r
-        #            \r
-        if (ArchItem == '' or ArchItem == None):\r
+        #\r
+        if (ArchItem == '' or ArchItem is None):\r
             ArchItem = 'COMMON'\r
 \r
-        if (ModuleItem == '' or ModuleItem == None):\r
+        if (ModuleItem == '' or ModuleItem is None):\r
             ModuleItem = 'COMMON'\r
 \r
         if ArchItem not in __SupArchList:\r
@@ -118,7 +112,7 @@ class InfLibraryClassObject():
 \r
     ##SetLibraryClasses\r
     #\r
-    # \r
+    #\r
     # @param HelpString:     It can be a common comment or contain a recommend\r
     #                        instance.\r
     #\r
@@ -136,7 +130,7 @@ class InfLibraryClassObject():
                 LibItemObj.CurrentLine.SetLineNo(LibItem[2][1])\r
                 LibItemObj.CurrentLine.SetLineString(LibItem[2][0])\r
                 LibItem = LibItem[0]\r
-                if HelpStringObj != None:\r
+                if HelpStringObj is not None:\r
                     LibItemObj.SetHelpString(HelpStringObj)\r
                 if len(LibItem) >= 1:\r
                     if LibItem[0].strip() != '':\r
@@ -173,7 +167,7 @@ class InfLibraryClassObject():
                                      Line=LibItemObj.CurrentLine.GetLineNo(),\r
                                      ExtraData=LibItemObj.CurrentLine.GetLineString())\r
                     #\r
-                    # Validate FFE    \r
+                    # Validate FFE\r
                     #\r
                     FeatureFlagRtv = IsValidFeatureFlagExp(LibItem[1].strip())\r
                     if not FeatureFlagRtv[0]:\r
@@ -202,15 +196,15 @@ class InfLibraryClassObject():
                 #\r
                 # Determine Library class duplicate. Follow below rule:\r
                 #\r
-                # A library class keyword must not be duplicated within a \r
-                # [LibraryClasses] section. Library class keywords may appear in \r
-                # multiple architectural and module type [LibraryClasses] sections. \r
-                # A library class keyword listed in an architectural or module type \r
-                # [LibraryClasses] section must not be listed in the common \r
+                # A library class keyword must not be duplicated within a\r
+                # [LibraryClasses] section. Library class keywords may appear in\r
+                # multiple architectural and module type [LibraryClasses] sections.\r
+                # A library class keyword listed in an architectural or module type\r
+                # [LibraryClasses] section must not be listed in the common\r
                 # architectural or module type [LibraryClasses] section.\r
-                # \r
+                #\r
                 # NOTE: This check will not report error now. But keep code for future enhancement.\r
-                # \r
+                #\r
 #                for Item in self.LibraryClasses:\r
 #                    if Item.GetLibName() == LibItemObj.GetLibName():\r
 #                        ItemSupArchList = Item.GetSupArchList()\r
@@ -238,7 +232,7 @@ class InfLibraryClassObject():
                 LibItemObj.SetVersion(LibItem[1])\r
                 LibItemObj.SetSupArchList(__SupArchList)\r
 \r
-            if self.LibraryClasses.has_key((LibItemObj)):\r
+            if (LibItemObj) in self.LibraryClasses:\r
                 LibraryList = self.LibraryClasses[LibItemObj]\r
                 LibraryList.append(LibItemObj)\r
                 self.LibraryClasses[LibItemObj] = LibraryList\r