summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-07-05 17:40:04 +0800
committerLiming Gao <liming.gao@intel.com>2018-07-09 10:25:47 +0800
commitf7496d717357b9af78414d19679b073403812340 (patch)
tree67621e65fd181bdf8a12d12e7706579beaaed0fb /BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
parent39456d00f36e04b7e7efb208f350f4e83b6c3531 (diff)
downloadedk2-f7496d717357b9af78414d19679b073403812340.tar.gz
edk2-f7496d717357b9af78414d19679b073403812340.tar.bz2
edk2-f7496d717357b9af78414d19679b073403812340.zip
BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/WorkspaceDatabase.py')
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index 9e055fcfc4..a40ab8fc8c 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
@@ -114,8 +114,8 @@ class WorkspaceDatabase(object):
# get the parser ready for this file
MetaFile = self._FILE_PARSER_[FileType](
- FilePath,
- FileType,
+ FilePath,
+ FileType,
Arch,
MetaFileStorage(self.WorkspaceDb.Cur, FilePath, FileType)
)
@@ -162,7 +162,7 @@ class WorkspaceDatabase(object):
# remove db file in case inconsistency between db and file in file system
if self._CheckWhetherDbNeedRenew(RenewDb, DbPath):
os.remove(DbPath)
-
+
# create db with optimized parameters
self.Conn = sqlite3.connect(DbPath, isolation_level='DEFERRED')
self.Conn.execute("PRAGMA synchronous=OFF")
@@ -199,11 +199,11 @@ class WorkspaceDatabase(object):
def _CheckWhetherDbNeedRenew (self, force, DbPath):
# if database does not exist, we need do nothing
if not os.path.exists(DbPath): return False
-
+
# if user force to renew database, then not check whether database is out of date
if force: return True
-
- #
+
+ #
# Check the time of last modified source file or build.exe
# if is newer than time of database, then database need to be re-created.
#
@@ -217,15 +217,15 @@ class WorkspaceDatabase(object):
if rootPath == "" or rootPath is None:
EdkLogger.verbose("\nFail to find the root path of build.exe or python sources, so can not \
determine whether database file is out of date!\n")
-
+
# walk the root path of source or build's binary to get the time last modified.
-
+
for root, dirs, files in os.walk (rootPath):
for dir in dirs:
- # bypass source control folder
+ # bypass source control folder
if dir.lower() in [".svn", "_svn", "cvs"]:
dirs.remove(dir)
-
+
for file in files:
ext = os.path.splitext(file)[1]
if ext.lower() == ".py": # only check .py files
@@ -235,9 +235,9 @@ determine whether database file is out of date!\n")
if timeOfToolModified > os.stat(DbPath).st_mtime:
EdkLogger.verbose("\nWorkspace database is out of data!")
return True
-
+
return False
-
+
## Initialize build database
def InitDatabase(self):
EdkLogger.verbose("\nInitialize build database started ...")