From 2d6b8d5ac951ee432512ca28db41ce32d0616849 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Wed, 30 Apr 2025 14:45:13 +0200 Subject: BaseTools: WorkSpace: Remove unnecessary code Running the vulture tool on the WorkSpace folder gave the following report. Remove the unnecessary code. - Workspace/BuildClassObject.py:148: unused method 'IsSimpleTypeArray' (60% confidence) - Workspace/BuildClassObject.py:337: unused method 'SetPcdMode' (60% confidence) - Workspace/BuildClassObject.py:612: unused attribute 'DscSpecification' (60% confidence) - Workspace/DscBuildData.py:451: unused property 'DscSpecification' (60% confidence) - Workspace/DscBuildData.py:1253: unused method 'GetBuildOptionsByPkg' (60% confidence) - Workspace/DscBuildData.py:2064: unused method 'GetStarNum' (60% confidence) - Workspace/DscBuildData.py:3613: unused method 'AddModule' (60% confidence) - Workspace/DscBuildData.py:3650: unused method 'AddPcd' (60% confidence) - Workspace/InfBuildData.py:117: unused attribute '_TailComments' (60% confidence) - Workspace/InfBuildData.py:126: unused attribute '_BinaryModule' (60% confidence) - Workspace/MetaDataTable.py:114: unused method 'IsIntegral' (60% confidence) - Workspace/MetaDataTable.py:218: unused method 'GetFileTimeStamp' (60% confidence) - Workspace/MetaDataTable.py:230: unused method 'SetFileTimeStamp' (60% confidence) - Workspace/MetaDataTable.py:298: unused method 'GetCrossIndex' (60% confidence) - Workspace/MetaFileParser.py:161: unused attribute '_FileDir' (60% confidence) - Workspace/MetaFileParser.py:1187: unused method '_DecodeCODEData' (60% confidence) - Workspace/MetaFileParser.py:1796: unused attribute '_RestofValue' (60% confidence) - Workspace/MetaFileTable.py:31: unused attribute '_NumpyTab' (60% confidence) - Workspace/WorkspaceDatabase.py:136: unused class 'TransformObjectFactory' (60% confidence) - Workspace/WorkspaceDatabase.py:159: unused attribute 'TransformObject' (60% confidence) Signed-off-by: Pierre Gondois --- BaseTools/Source/Python/Workspace/MetaDataTable.py | 46 ---------------------- 1 file changed, 46 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 a20bd14784..325d01ae04 100644 --- a/BaseTools/Source/Python/Workspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py @@ -110,14 +110,6 @@ class Table(object): Tab = self.Db.GetTable(self.Table) Tab.append(self._DUMMY_) - - def IsIntegral(self): - tab = self.Db.GetTable(self.Table) - Id = min([int(item[0]) for item in tab]) - if Id != -1: - return False - return True - def GetAll(self): tab = self.Db.GetTable(self.Table) return tab @@ -209,27 +201,6 @@ class TableFile(Table): return None return RecordList[0][0] - ## Get file timestamp of a given file - # - # @param FileId ID of file - # - # @retval timestamp TimeStamp value of given file in the table - # - def GetFileTimeStamp(self, FileId): - QueryScript = "select TimeStamp from %s where ID = '%s'" % (self.Table, FileId) - RecordList = self.Exec(QueryScript) - if len(RecordList) == 0: - return None - return RecordList[0][0] - - ## Update the timestamp of a given file - # - # @param FileId ID of file - # @param TimeStamp Time stamp of file - # - def SetFileTimeStamp(self, FileId, TimeStamp): - self.Exec("update %s set TimeStamp=%s where ID='%s'" % (self.Table, TimeStamp, FileId)) - ## Get list of file with given type # # @param FileType Type value of file @@ -287,20 +258,3 @@ class TableDataModel(Table): Description = Item[0] self.Insert(CrossIndex, Name, Description) EdkLogger.verbose("Initialize table DataModel ... DONE!") - - ## Get CrossIndex - # - # Get a model's cross index from its name - # - # @param ModelName: Name of the model - # @retval CrossIndex: CrossIndex of the model - # - def GetCrossIndex(self, ModelName): - CrossIndex = -1 - SqlCommand = """select CrossIndex from DataModel where name = '""" + ModelName + """'""" - self.Db.execute(SqlCommand) - for Item in self.Db: - CrossIndex = Item[0] - - return CrossIndex - -- cgit v1.2.3