]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: AutoGen - refactor class properties
authorCarsey, Jaben <jaben.carsey@intel.com>
Mon, 10 Sep 2018 22:18:03 +0000 (06:18 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 20 Sep 2018 14:18:06 +0000 (22:18 +0800)
use function decorators

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>
BaseTools/Source/Python/AutoGen/GenMake.py

index 35ee98c82bb134a75d4271b6bde9e4f3c685a413..b4377eef17d7e3e3004b8f47fbb143eb0aaea75c 100644 (file)
@@ -455,7 +455,8 @@ cleanlib:
         self.FfsOutputFileList = []\r
 \r
     # Compose a dict object containing information used to do replacement in template\r
-    def _CreateTemplateDict(self):\r
+    @property\r
+    def _TemplateDict(self):\r
         if self._FileType not in self._SEP_:\r
             EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile type [%s]" % self._FileType,\r
                             ExtraData="[%s]" % str(self._AutoGenObject))\r
@@ -1095,8 +1096,6 @@ cleanlib:
 \r
         return DependencyList\r
 \r
-    _TemplateDict = property(_CreateTemplateDict)\r
-\r
 ## CustomMakefile class\r
 #\r
 #  This class encapsules makefie and its generation for module. It uses template to generate\r
@@ -1205,7 +1204,8 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
         self.IntermediateDirectoryList = ["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]\r
 \r
     # Compose a dict object containing information used to do replacement in template\r
-    def _CreateTemplateDict(self):\r
+    @property\r
+    def _TemplateDict(self):\r
         Separator = self._SEP_[self._FileType]\r
         MyAgo = self._AutoGenObject\r
         if self._FileType not in MyAgo.CustomMakefile:\r
@@ -1278,8 +1278,6 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\
 \r
         return MakefileTemplateDict\r
 \r
-    _TemplateDict = property(_CreateTemplateDict)\r
-\r
 ## PlatformMakefile class\r
 #\r
 #  This class encapsules makefie and its generation for platform. It uses\r
@@ -1396,7 +1394,8 @@ cleanlib:
         self.LibraryMakeCommandList = []\r
 \r
     # Compose a dict object containing information used to do replacement in template\r
-    def _CreateTemplateDict(self):\r
+    @property\r
+    def _TemplateDict(self):\r
         Separator = self._SEP_[self._FileType]\r
 \r
         MyAgo = self._AutoGenObject\r
@@ -1481,8 +1480,6 @@ cleanlib:
                 DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))\r
         return DirList\r
 \r
-    _TemplateDict = property(_CreateTemplateDict)\r
-\r
 ## TopLevelMakefile class\r
 #\r
 #  This class encapsules makefie and its generation for entrance makefile. It\r
@@ -1502,7 +1499,8 @@ class TopLevelMakefile(BuildFile):
         self.IntermediateDirectoryList = []\r
 \r
     # Compose a dict object containing information used to do replacement in template\r
-    def _CreateTemplateDict(self):\r
+    @property\r
+    def _TemplateDict(self):\r
         Separator = self._SEP_[self._FileType]\r
 \r
         # any platform autogen object is ok because we just need common information\r
@@ -1622,8 +1620,6 @@ class TopLevelMakefile(BuildFile):
                 DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))\r
         return DirList\r
 \r
-    _TemplateDict = property(_CreateTemplateDict)\r
-\r
 # This acts like the main() function for the script, unless it is 'import'ed into another script.\r
 if __name__ == '__main__':\r
     pass\r