## @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
# 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
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
# self.TblDataModel.Drop()\r
# self.TblDsc.Drop()\r
# self.TblFile.Drop()\r
- \r
+\r
#\r
# Create new tables\r
#\r
self.TblInf.Create()\r
self.TblDec.Create()\r
self.TblDsc.Create()\r
- \r
+\r
#\r
# Initialize table DataModel\r
#\r
#\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
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