]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py
BaseTools: Unify long and int in Expression.py
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / MetaFileWorkspace / MetaFileTable.py
index 89bc7f262f30ac347af6c4f6381b7b0275084864..9faa6b58b001ad927f33a48ef80d450da52c3741 100644 (file)
@@ -51,6 +51,7 @@ class ModuleTable(MetaFileTable):
         Value1 TEXT NOT NULL,\r
         Value2 TEXT,\r
         Value3 TEXT,\r
+        Usage  TEXT,\r
         Scope1 TEXT,\r
         Scope2 TEXT,\r
         BelongsToItem REAL NOT NULL,\r
@@ -84,14 +85,15 @@ class ModuleTable(MetaFileTable):
     # @param Enabled:        If this item enabled\r
     #\r
     def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',\r
-               BelongsToItem=-1, BelongsToFile = -1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):\r
-        (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))\r
+               BelongsToItem=-1, BelongsToFile = -1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0, Usage=''):\r
+        (Value1, Value2, Value3, Usage, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Usage, Scope1, Scope2))\r
         return Table.Insert(\r
                         self, \r
                         Model, \r
                         Value1, \r
                         Value2, \r
                         Value3, \r
+                        Usage,                         \r
                         Scope1, \r
                         Scope2,\r
                         BelongsToItem,\r
@@ -113,11 +115,11 @@ class ModuleTable(MetaFileTable):
     #\r
     def Query(self, Model, Arch=None, Platform=None):\r
         ConditionString = "Model=%s AND Enabled>=0" % Model\r
-        ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"\r
+        ValueString = "Value1,Value2,Value3,Usage,Scope1,Scope2,ID,StartLine"\r
 \r
-        if Arch != None and Arch != 'COMMON':\r
+        if Arch is not None and Arch != 'COMMON':\r
             ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch\r
-        if Platform != None and Platform != 'COMMON':\r
+        if Platform is not None and Platform != 'COMMON':\r
             ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform\r
 \r
         SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)\r
@@ -196,7 +198,7 @@ class PackageTable(MetaFileTable):
         ConditionString = "Model=%s AND Enabled>=0" % Model\r
         ValueString = "Value1,Value2,Value3,Scope1,ID,StartLine"\r
 \r
-        if Arch != None and Arch != 'COMMON':\r
+        if Arch is not None and Arch != 'COMMON':\r
             ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch\r
 \r
         SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)\r
@@ -281,17 +283,17 @@ class PlatformTable(MetaFileTable):
         ConditionString = "Model=%s AND Enabled>0" % Model\r
         ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"\r
 \r
-        if Scope1 != None and Scope1 != 'COMMON':\r
+        if Scope1 is not None and Scope1 != 'COMMON':\r
             ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1\r
-        if Scope2 != None and Scope2 != 'COMMON':\r
+        if Scope2 is not None and Scope2 != 'COMMON':\r
             ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r
 \r
-        if BelongsToItem != None:\r
+        if BelongsToItem is not None:\r
             ConditionString += " AND BelongsToItem=%s" % BelongsToItem\r
         else:\r
             ConditionString += " AND BelongsToItem<0"\r
 \r
-        if FromItem != None:\r
+        if FromItem is not None:\r
             ConditionString += " AND FromItem=%s" % FromItem\r
 \r
         SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)\r