]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Check.py
BaseTools: Remove the old python "not-equal"
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Check.py
index 5864758950ce973ccfb0094a732b24cf7b647adb..ea739043e0bca88c58b52d2e5025941e938e15d5 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define checkpoints used by ECC tool\r
 #\r
-# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -744,7 +744,7 @@ class Check(object):
                         if Item not in LibraryClasses[List[0]]:\r
                             LibraryClasses[List[0]].append(Item)\r
 \r
-                if Record[2] != 'BASE' and Record[2] not in SupModType:\r
+                if Record[2] != DT.SUP_MODULE_BASE and Record[2] not in SupModType:\r
                     EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2, OtherMsg="The Library Class '%s' does not specify its supported module types" % (List[0]), BelongsToTable='Inf', BelongsToItem=Record[0])\r
 \r
             SqlCommand = """select A.ID, A.Value1, B.Value3 from Inf as A left join Inf as B\r
@@ -763,7 +763,7 @@ class Check(object):
 \r
             for Record in RecordSet:\r
                 if Record[1] in LibraryClasses:\r
-                    if Record[2] not in LibraryClasses[Record[1]] and 'BASE' not in RecordDict[Record[1]]:\r
+                    if Record[2] not in LibraryClasses[Record[1]] and DT.SUP_MODULE_BASE not in RecordDict[Record[1]]:\r
                         if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]):\r
                             EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg="The type of Library Class [%s] defined in Inf file does not match the type of the module" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])\r
                 else:\r
@@ -787,7 +787,7 @@ class Check(object):
                         continue\r
                     SqlCommand = """select Value3 from Inf where BelongsToFile =\r
                                     (select ID from File where lower(FullPath) = lower('%s'))\r
-                                    and Value2 = '%s'""" % (LibraryIns, 'LIBRARY_CLASS')\r
+                                    and Value2 = '%s'""" % (LibraryIns, DT.PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS)\r
                     RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)\r
                     IsFound = False\r
                     for Record in RecordSet:\r
@@ -816,8 +816,8 @@ class Check(object):
                     EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, OtherMsg="The Library Class [%s] is not used in any platform" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])\r
             SqlCommand = """\r
                          select A.ID, A.Value1, A.BelongsToFile, A.StartLine, B.StartLine from Dsc as A left join Dsc as B\r
-                         where A.Model = %s and B.Model = %s and A.Scope1 = B.Scope1 and A.Scope2 = B.Scope2 and A.ID <> B.ID\r
-                         and A.Value1 = B.Value1 and A.Value2 <> B.Value2 and A.BelongsToItem = -1 and B.BelongsToItem = -1 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \\r
+                         where A.Model = %s and B.Model = %s and A.Scope1 = B.Scope1 and A.Scope2 = B.Scope2 and A.ID != B.ID\r
+                         and A.Value1 = B.Value1 and A.Value2 != B.Value2 and A.BelongsToItem = -1 and B.BelongsToItem = -1 and A.StartLine != B.StartLine and B.BelongsToFile = A.BelongsToFile""" \\r
                             % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)\r
             RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)\r
             for Record in RecordSet:\r
@@ -903,7 +903,7 @@ class Check(object):
                          and A.Value1 = B.Value1\r
                          and A.Value2 = B.Value2\r
                          and A.Scope1 = B.Scope1\r
-                         and A.ID <> B.ID\r
+                         and A.ID != B.ID\r
                          and A.Model = B.Model\r
                          and A.Enabled > -1\r
                          and B.Enabled > -1\r
@@ -1055,7 +1055,7 @@ class Check(object):
             SqlCommand = """\r
                          select A.ID, A.Value3, A.BelongsToFile, B.BelongsToFile from %s as A, %s as B\r
                          where A.Value2 = 'FILE_GUID' and B.Value2 = 'FILE_GUID' and\r
-                         A.Value3 = B.Value3 and A.ID <> B.ID group by A.ID\r
+                         A.Value3 = B.Value3 and A.ID != B.ID group by A.ID\r
                          """ % (Table.Table, Table.Table)\r
             RecordSet = Table.Exec(SqlCommand)\r
             for Record in RecordSet:\r
@@ -1215,7 +1215,7 @@ class Check(object):
         SqlCommand = """\r
                      select A.ID, A.Value1 from %s as A, %s as B\r
                      where A.Model = %s and B.Model = %s\r
-                     and A.Value1 like B.Value1 and A.ID <> B.ID\r
+                     and A.Value1 like B.Value1 and A.ID != B.ID\r
                      and A.Scope1 = B.Scope1\r
                      and A.Enabled > -1\r
                      and B.Enabled > -1\r
@@ -1239,8 +1239,8 @@ class Check(object):
         SqlCommand = """\r
                      select A.ID, A.Value1, A.Value2 from %s as A, %s as B\r
                      where A.Model = %s and B.Model = %s\r
-                     and A.Value2 like B.Value2 and A.ID <> B.ID\r
-                     and A.Scope1 = B.Scope1 and A.Value1 <> B.Value1\r
+                     and A.Value2 like B.Value2 and A.ID != B.ID\r
+                     and A.Scope1 = B.Scope1 and A.Value1 != B.Value1\r
                      group by A.ID\r
                      """ % (Table.Table, Table.Table, Model, Model)\r
         RecordSet = Table.Exec(SqlCommand)\r
@@ -1299,7 +1299,7 @@ class Check(object):
             RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 Name = Record[1].strip()\r
-                if Name != '' and Name != None:\r
+                if Name != '' and Name is not None:\r
                     if Name[0] == '(':\r
                         Name = Name[1:Name.find(')')]\r
                     if Name.find('(') > -1:\r