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
This commit is contained in:
lgao4
2011-10-29 06:59:30 +00:00
parent 421fb3b504
commit 0d2711a693
80 changed files with 5138 additions and 4325 deletions

View File

@ -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