]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/Database.py
BaseTools: Use absolute import in Common
[mirror_edk2.git] / BaseTools / Source / Python / Common / Database.py
index e645337a39a14c2f414edfabcdf66761be162951..1c543aeb41b15efeead4a0f023856e97ad175d85 100644 (file)
@@ -1,8 +1,8 @@
 ## @file\r
 # This file is used to create a database used by ECC tool\r
 #\r
-# Copyright (c) 2007 ~ 2008, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2007 - 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
 # http://opensource.org/licenses/bsd-license.php\r
 ##\r
 # Import Modules\r
 #\r
+from __future__ import absolute_import\r
 import sqlite3\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
-import EdkLogger as EdkLogger\r
+from . import EdkLogger as EdkLogger\r
 from CommonDataClass.DataClass import *\r
-from String import *\r
-from DataType import *\r
+from .StringUtils import *\r
+from .DataType import *\r
 \r
 from Table.TableDataModel import TableDataModel\r
 from Table.TableFile import TableFile\r
@@ -33,7 +34,7 @@ from Table.TableDsc import TableDsc
 # This class defined the build databse\r
 # During the phase of initialization, the database will create all tables and\r
 # insert all records of table DataModel\r
-# \r
+#\r
 # @param object:      Inherited from object class\r
 # @param DbPath:      A string for the path of the ECC database\r
 #\r
@@ -54,7 +55,7 @@ class Database(object):
         self.TblInf = TableInf(self.Cur)\r
         self.TblDec = TableDec(self.Cur)\r
         self.TblDsc = TableDsc(self.Cur)\r
-    \r
+\r
     ## Initialize build database\r
     #\r
     # 1. Delete all old existing tables\r
@@ -69,7 +70,7 @@ class Database(object):
 #        self.TblDataModel.Drop()\r
 #        self.TblDsc.Drop()\r
 #        self.TblFile.Drop()\r
-        \r
+\r
         #\r
         # Create new tables\r
         #\r
@@ -78,7 +79,7 @@ class Database(object):
         self.TblInf.Create()\r
         self.TblDec.Create()\r
         self.TblDsc.Create()\r
-        \r
+\r
         #\r
         # Initialize table DataModel\r
         #\r
@@ -91,10 +92,10 @@ class Database(object):
     #\r
     def QueryTable(self, Table):\r
         Table.Query()\r
-    \r
+\r
     ## Close entire database\r
     #\r
-    # Commit all first \r
+    # Commit all first\r
     # Close the connection and cursor\r
     #\r
     def Close(self):\r
@@ -110,11 +111,10 @@ class Database(object):
 if __name__ == '__main__':\r
     EdkLogger.Initialize()\r
     EdkLogger.SetLevel(EdkLogger.DEBUG_0)\r
-    \r
+\r
     Db = Database(DATABASE_PATH)\r
     Db.InitDatabase()\r
-    Db.QueryTable(Db.TblDataModel)   \r
+    Db.QueryTable(Db.TblDataModel)\r
     Db.QueryTable(Db.TblFile)\r
     Db.QueryTable(Db.TblDsc)\r
     Db.Close()\r
-    
\ No newline at end of file