]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: make static functions when self is not needed
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Fri, 30 Mar 2018 00:19:32 +0000 (08:19 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 3 Apr 2018 09:38:42 +0000 (17:38 +0800)
remove self, and add @staticmethod to functions

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/Common/FdfParserLite.py
BaseTools/Source/Python/GenFds/FdfParser.py

index 692e8aeb3f4e274dc44764dd3b991dffc091b89c..dd822505d3d3dfaa0d7c570a562a922adb020fbc 100644 (file)
@@ -2130,13 +2130,12 @@ class FdfParser(object):
     #\r
     #   Check whether reloc strip flag can be set for a file type.\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  FileType    The file type to check with\r
     #   @retval True        This type could have relocation strip flag\r
     #   @retval False       No way to have it\r
     #\r
-    \r
-    def __FileCouldHaveRelocFlag (self, FileType):\r
+    @staticmethod\r
+    def __FileCouldHaveRelocFlag (FileType):\r
         if FileType in ('SEC', 'PEI_CORE', 'PEIM', 'PEI_DXE_COMBO'):\r
             return True\r
         else:\r
@@ -2146,13 +2145,12 @@ class FdfParser(object):
     #\r
     #   Check whether reloc strip flag can be set for a section type.\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check with\r
     #   @retval True        This type could have relocation strip flag\r
     #   @retval False       No way to have it\r
     #\r
-    \r
-    def __SectionCouldHaveRelocFlag (self, SectionType):\r
+    @staticmethod\r
+    def __SectionCouldHaveRelocFlag (SectionType):\r
         if SectionType in ('TE', 'PE32'):\r
             return True\r
         else:\r
@@ -3152,12 +3150,12 @@ class FdfParser(object):
     #\r
     #   Get whether a section could be optional\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could be optional\r
     #   @retval False       section never optional\r
     #\r
-    def __RuleSectionCouldBeOptional(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldBeOptional(SectionType):\r
         if SectionType in ("DXE_DEPEX", "UI", "VERSION", "PEI_DEPEX", "RAW", "SMM_DEPEX"):\r
             return True\r
         else:\r
@@ -3167,12 +3165,12 @@ class FdfParser(object):
     #\r
     #   Get whether a section could have build number information\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could have build number information\r
     #   @retval False       section never have build number information\r
     #\r
-    def __RuleSectionCouldHaveBuildNum(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldHaveBuildNum(SectionType):\r
         if SectionType in ("VERSION"):\r
             return True\r
         else:\r
@@ -3182,12 +3180,12 @@ class FdfParser(object):
     #\r
     #   Get whether a section could have string\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could have string\r
     #   @retval False       section never have string\r
     #\r
-    def __RuleSectionCouldHaveString(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldHaveString(SectionType):\r
         if SectionType in ("UI", "VERSION"):\r
             return True\r
         else:\r
index 5dbcb96bbd834b204481096e8407457954f9ddc4..9b7e898570a3ecfd0d34364fa1ba65b4f519bd59 100644 (file)
@@ -704,7 +704,8 @@ class FdfParser:
         # Preprocess done.\r
         self.Rewind()\r
         \r
-    def __GetIfListCurrentItemStat(self, IfList):\r
+    @staticmethod\r
+    def __GetIfListCurrentItemStat(IfList):\r
         if len(IfList) == 0:\r
             return True\r
         \r
@@ -2625,13 +2626,12 @@ class FdfParser:
     #\r
     #   Check whether reloc strip flag can be set for a file type.\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  FileType    The file type to check with\r
     #   @retval True        This type could have relocation strip flag\r
     #   @retval False       No way to have it\r
     #\r
-\r
-    def __FileCouldHaveRelocFlag (self, FileType):\r
+    @staticmethod\r
+    def __FileCouldHaveRelocFlag (FileType):\r
         if FileType in ('SEC', 'PEI_CORE', 'PEIM', 'PEI_DXE_COMBO'):\r
             return True\r
         else:\r
@@ -2641,13 +2641,12 @@ class FdfParser:
     #\r
     #   Check whether reloc strip flag can be set for a section type.\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check with\r
     #   @retval True        This type could have relocation strip flag\r
     #   @retval False       No way to have it\r
     #\r
-\r
-    def __SectionCouldHaveRelocFlag (self, SectionType):\r
+    @staticmethod\r
+    def __SectionCouldHaveRelocFlag (SectionType):\r
         if SectionType in ('TE', 'PE32'):\r
             return True\r
         else:\r
@@ -3986,12 +3985,12 @@ class FdfParser:
     #\r
     #   Get whether a section could be optional\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could be optional\r
     #   @retval False       section never optional\r
     #\r
-    def __RuleSectionCouldBeOptional(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldBeOptional(SectionType):\r
         if SectionType in ("DXE_DEPEX", "UI", "VERSION", "PEI_DEPEX", "RAW", "SMM_DEPEX"):\r
             return True\r
         else:\r
@@ -4001,12 +4000,12 @@ class FdfParser:
     #\r
     #   Get whether a section could have build number information\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could have build number information\r
     #   @retval False       section never have build number information\r
     #\r
-    def __RuleSectionCouldHaveBuildNum(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldHaveBuildNum(SectionType):\r
         if SectionType in ("VERSION"):\r
             return True\r
         else:\r
@@ -4016,12 +4015,12 @@ class FdfParser:
     #\r
     #   Get whether a section could have string\r
     #\r
-    #   @param  self        The object pointer\r
     #   @param  SectionType The section type to check\r
     #   @retval True        section could have string\r
     #   @retval False       section never have string\r
     #\r
-    def __RuleSectionCouldHaveString(self, SectionType):\r
+    @staticmethod\r
+    def __RuleSectionCouldHaveString(SectionType):\r
         if SectionType in ("UI", "VERSION"):\r
             return True\r
         else:\r