]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceDatabase.py
index a3407d113e0f437dbb2b6a5af65cd65d1a3969d8..9e055fcfc46bf8a038827a838c2cb84a5476b36c 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create a database used by build 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
 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,7 +16,7 @@
 # Import Modules\r
 #\r
 import sqlite3\r
-from Common.String import *\r
+from Common.StringUtils import *\r
 from Common.DataType import *\r
 from Common.Misc import *\r
 from types import *\r
@@ -214,7 +214,7 @@ class WorkspaceDatabase(object):
         else:\r
             curPath  = os.path.dirname(__file__) # curPath is the path of WorkspaceDatabase.py\r
             rootPath = os.path.split(curPath)[0] # rootPath is root path of python source, such as /BaseTools/Source/Python\r
-            if rootPath == "" or rootPath == None:\r
+            if rootPath == "" or rootPath is None:\r
                 EdkLogger.verbose("\nFail to find the root path of build.exe or python sources, so can not \\r
 determine whether database file is out of date!\n")\r
         \r
@@ -280,7 +280,7 @@ determine whether database file is out of date!\n")
     def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):\r
         self.Platform = Platform\r
         PackageList = []\r
-        Pa = self.BuildObject[self.Platform, Arch]\r
+        Pa = self.BuildObject[self.Platform, Arch, TargetName, ToolChainTag]\r
         #\r
         # Get Package related to Modules\r
         #\r
@@ -305,16 +305,16 @@ determine whether database file is out of date!\n")
         PlatformList = []\r
         for PlatformFile in self.TblFile.GetFileList(MODEL_FILE_DSC):\r
             try:\r
-                Platform = self.BuildObject[PathClass(PlatformFile), 'COMMON']\r
+                Platform = self.BuildObject[PathClass(PlatformFile), TAB_COMMON]\r
             except:\r
                 Platform = None\r
-            if Platform != None:\r
+            if Platform is not None:\r
                 PlatformList.append(Platform)\r
         return PlatformList\r
 \r
     def _MapPlatform(self, Dscfile):\r
-        Platform = self.BuildObject[PathClass(Dscfile), 'COMMON']\r
-        if Platform == None:\r
+        Platform = self.BuildObject[PathClass(Dscfile), TAB_COMMON]\r
+        if Platform is None:\r
             EdkLogger.error('build', PARSER_ERROR, "Failed to parser DSC file: %s" % Dscfile)\r
         return Platform\r
 \r