summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaDataTable.py
diff options
context:
space:
mode:
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