From 227dbb11905008602b583b06f2b84e741bdd09e0 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 14 Apr 2018 04:51:35 +0800 Subject: BaseTools: FdfParser - refactor functions to make static make functions that doesn't use self into @staticmethod Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/GenFds/FdfParser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py') diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 662c232c86..dce41701a5 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1131,7 +1131,8 @@ class FdfParser: self.__UndoToken() return False - def __Verify(self, Name, Value, Scope): + @staticmethod + def __Verify(Name, Value, Scope): if Scope in ['UINT64', 'UINT8']: ValueNumber = 0 try: @@ -3200,16 +3201,16 @@ class FdfParser: raise Warning("expected value of %s" % Name, self.FileName, self.CurrentLineNumber) Value = self.__Token if Name == 'IMAGE_HEADER_INIT_VERSION': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.Version = Value elif Name == 'IMAGE_INDEX': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.ImageIndex = Value elif Name == 'HARDWARE_INSTANCE': - if self.__Verify(Name, Value, 'UINT8'): + if FdfParser.__Verify(Name, Value, 'UINT8'): FmpData.HardwareInstance = Value elif Name == 'MONOTONIC_COUNT': - if self.__Verify(Name, Value, 'UINT64'): + if FdfParser.__Verify(Name, Value, 'UINT64'): FmpData.MonotonicCount = Value if FmpData.MonotonicCount.upper().startswith('0X'): FmpData.MonotonicCount = (long)(FmpData.MonotonicCount, 16) -- cgit v1.2.3