From 0d2711a69397d2971079121df4326d84736c181e Mon Sep 17 00:00:00 2001 From: lgao4 Date: Sat, 29 Oct 2011 06:59:30 +0000 Subject: 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 --- BaseTools/Source/Python/Workspace/MetaDataTable.py | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/MetaDataTable.py') 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 -- cgit v1.2.3