# 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
\r
# get the parser ready for this file\r
MetaFile = self._FILE_PARSER_[FileType](\r
- FilePath, \r
- FileType, \r
+ FilePath,\r
+ FileType,\r
Arch,\r
MetaFileStorage(self.WorkspaceDb.Cur, FilePath, FileType)\r
)\r
# remove db file in case inconsistency between db and file in file system\r
if self._CheckWhetherDbNeedRenew(RenewDb, DbPath):\r
os.remove(DbPath)\r
- \r
+\r
# create db with optimized parameters\r
self.Conn = sqlite3.connect(DbPath, isolation_level='DEFERRED')\r
self.Conn.execute("PRAGMA synchronous=OFF")\r
def _CheckWhetherDbNeedRenew (self, force, DbPath):\r
# if database does not exist, we need do nothing\r
if not os.path.exists(DbPath): return False\r
- \r
+\r
# if user force to renew database, then not check whether database is out of date\r
if force: return True\r
- \r
- # \r
+\r
+ #\r
# Check the time of last modified source file or build.exe\r
# if is newer than time of database, then database need to be re-created.\r
#\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
+\r
# walk the root path of source or build's binary to get the time last modified.\r
- \r
+\r
for root, dirs, files in os.walk (rootPath):\r
for dir in dirs:\r
- # bypass source control folder \r
+ # bypass source control folder\r
if dir.lower() in [".svn", "_svn", "cvs"]:\r
dirs.remove(dir)\r
- \r
+\r
for file in files:\r
ext = os.path.splitext(file)[1]\r
if ext.lower() == ".py": # only check .py files\r
if timeOfToolModified > os.stat(DbPath).st_mtime:\r
EdkLogger.verbose("\nWorkspace database is out of data!")\r
return True\r
- \r
+\r
return False\r
- \r
+\r
## Initialize build database\r
def InitDatabase(self):\r
EdkLogger.verbose("\nInitialize build database started ...")\r