summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaDataTable.py
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-29 06:59:30 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-29 06:59:30 +0000
commit0d2711a69397d2971079121df4326d84736c181e (patch)
tree0d3c93b9db1df5a30a0d15ec9d70c75768c1f67c /BaseTools/Source/Python/Workspace/MetaDataTable.py
parent421fb3b504cfe18033c49a40fcd46bab45a0fb50 (diff)
downloadedk2-platforms-0d2711a69397d2971079121df4326d84736c181e.tar.xz
Sync BaseTools Trunk (version r2387) to EDKII main trunk.
Signed-off-by: lgao4 Reviewed-by: gikidy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12602 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaDataTable.py')
-rw-r--r--BaseTools/Source/Python/Workspace/MetaDataTable.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py b/BaseTools/Source/Python/Workspace/MetaDataTable.py
index 64f0480c37..34ef4903df 100644
--- a/BaseTools/Source/Python/Workspace/MetaDataTable.py
+++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py
@@ -140,6 +140,10 @@ class Table(object):
def SetEndFlag(self):
self.Exec("insert into %s values(%s)" % (self.Table, self._DUMMY_))
+ #
+ # Need to execution commit for table data changed.
+ #
+ self.Cur.connection.commit()
def IsIntegral(self):
Result = self.Exec("select min(ID) from %s" % (self.Table))
@@ -147,6 +151,9 @@ class Table(object):
return False
return True
+ def GetAll(self):
+ return self.Exec("select * from %s where ID > 0 order by ID" % (self.Table))
+
## TableFile
#
# This class defined a table used for file
@@ -198,19 +205,15 @@ class TableFile(Table):
#
# @retval FileID: The ID after record is inserted
#
- def InsertFile(self, FileFullPath, Model):
- (Filepath, Name) = os.path.split(FileFullPath)
- (Root, Ext) = os.path.splitext(FileFullPath)
- TimeStamp = os.stat(FileFullPath)[8]
- File = FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '', [], [], [])
+ def InsertFile(self, File, Model):
return self.Insert(
- Name,
- Ext,
- Filepath,
- FileFullPath,
- Model,
- TimeStamp
- )
+ File.Name,
+ File.Ext,
+ File.Dir,
+ File.Path,
+ Model,
+ File.TimeStamp
+ )
## Get ID of a given file
#
@@ -218,8 +221,8 @@ class TableFile(Table):
#
# @retval ID ID value of given file in the table
#
- def GetFileId(self, FilePath):
- QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, FilePath)
+ def GetFileId(self, File):
+ QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
RecordList = self.Exec(QueryScript)
if len(RecordList) == 0:
return None