BaseTools: Workspace classes refactor properties

1) use decorators
2) also change some private functions to public when all callers are
external
3) change external callers to use functions instead of directly
accessing private data.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Carsey, Jaben
2018-09-11 06:18:05 +08:00
committed by Yonghong Zhu
parent 6c204ed4f2
commit 71cac3f791
7 changed files with 228 additions and 235 deletions

View File

@ -302,25 +302,21 @@ determine whether database file is out of date!\n")
return PackageList
## Summarize all platforms in the database
def _GetPlatformList(self):
PlatformList = []
def PlatformList(self):
RetVal = []
for PlatformFile in self.TblFile.GetFileList(MODEL_FILE_DSC):
try:
Platform = self.BuildObject[PathClass(PlatformFile), TAB_COMMON]
RetVal.append(self.BuildObject[PathClass(PlatformFile), TAB_COMMON])
except:
Platform = None
if Platform is not None:
PlatformList.append(Platform)
return PlatformList
pass
return RetVal
def _MapPlatform(self, Dscfile):
def MapPlatform(self, Dscfile):
Platform = self.BuildObject[PathClass(Dscfile), TAB_COMMON]
if Platform is None:
EdkLogger.error('build', PARSER_ERROR, "Failed to parser DSC file: %s" % Dscfile)
return Platform
PlatformList = property(_GetPlatformList)
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another