BaseTools: remove the super() function argument
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Yonghong Zhu
parent
5135cc4852
commit
4ce4f757d7
@ -198,11 +198,11 @@ class AutoGen(object):
|
|||||||
# if it exists, just return it directly
|
# if it exists, just return it directly
|
||||||
return cls.__ObjectCache[Key]
|
return cls.__ObjectCache[Key]
|
||||||
# it didnt exist. create it, cache it, then return it
|
# it didnt exist. create it, cache it, then return it
|
||||||
RetVal = cls.__ObjectCache[Key] = super(AutoGen, cls).__new__(cls)
|
RetVal = cls.__ObjectCache[Key] = super().__new__(cls)
|
||||||
return RetVal
|
return RetVal
|
||||||
|
|
||||||
def __init__ (self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
def __init__ (self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
||||||
super(AutoGen, self).__init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
super().__init__()
|
||||||
|
|
||||||
## hash() operator
|
## hash() operator
|
||||||
#
|
#
|
||||||
@ -235,7 +235,7 @@ class WorkspaceAutoGen(AutoGen):
|
|||||||
# call super().__init__ then call the worker function with different parameter count
|
# call super().__init__ then call the worker function with different parameter count
|
||||||
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
||||||
if not hasattr(self, "_Init"):
|
if not hasattr(self, "_Init"):
|
||||||
super(WorkspaceAutoGen, self).__init__(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
super().__init__(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||||
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||||
self._Init = True
|
self._Init = True
|
||||||
|
|
||||||
@ -973,7 +973,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
# call super().__init__ then call the worker function with different parameter count
|
# call super().__init__ then call the worker function with different parameter count
|
||||||
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
||||||
if not hasattr(self, "_Init"):
|
if not hasattr(self, "_Init"):
|
||||||
super(PlatformAutoGen, self).__init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
super().__init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||||
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch)
|
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch)
|
||||||
self._Init = True
|
self._Init = True
|
||||||
#
|
#
|
||||||
@ -2425,7 +2425,7 @@ class ModuleAutoGen(AutoGen):
|
|||||||
# call super().__init__ then call the worker function with different parameter count
|
# call super().__init__ then call the worker function with different parameter count
|
||||||
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
|
||||||
if not hasattr(self, "_Init"):
|
if not hasattr(self, "_Init"):
|
||||||
super(ModuleAutoGen, self).__init__(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
super().__init__(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||||
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args)
|
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args)
|
||||||
self._Init = True
|
self._Init = True
|
||||||
|
|
||||||
@ -2439,7 +2439,7 @@ class ModuleAutoGen(AutoGen):
|
|||||||
EdkLogger.verbose("Module [%s] for [%s] is not employed by active platform\n" \
|
EdkLogger.verbose("Module [%s] for [%s] is not employed by active platform\n" \
|
||||||
% (MetaFile, Arch))
|
% (MetaFile, Arch))
|
||||||
return None
|
return None
|
||||||
return super(ModuleAutoGen, cls).__new__(cls, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
return super().__new__(cls, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||||
|
|
||||||
## Initialize ModuleAutoGen
|
## Initialize ModuleAutoGen
|
||||||
#
|
#
|
||||||
|
@ -241,7 +241,7 @@ class VAR_CHECK_PCD_VALID_OBJ(object):
|
|||||||
|
|
||||||
class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ):
|
class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ):
|
||||||
def __init__(self, VarOffset, validlist, PcdDataType):
|
def __init__(self, VarOffset, validlist, PcdDataType):
|
||||||
super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlist, PcdDataType)
|
super().__init__(VarOffset, validlist, PcdDataType)
|
||||||
self.Type = 1
|
self.Type = 1
|
||||||
valid_num_list = []
|
valid_num_list = []
|
||||||
for item in self.rawdata:
|
for item in self.rawdata:
|
||||||
@ -261,7 +261,7 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ):
|
|||||||
|
|
||||||
class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ):
|
class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ):
|
||||||
def __init__(self, VarOffset, validrange, PcdDataType):
|
def __init__(self, VarOffset, validrange, PcdDataType):
|
||||||
super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validrange, PcdDataType)
|
super().__init__(VarOffset, validrange, PcdDataType)
|
||||||
self.Type = 2
|
self.Type = 2
|
||||||
RangeExpr = ""
|
RangeExpr = ""
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -204,7 +204,7 @@ SupportedInMacroList = ['TARGET', 'TOOL_CHAIN_TAG', 'ARCH', 'FAMILY']
|
|||||||
|
|
||||||
class BaseExpression(object):
|
class BaseExpression(object):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(BaseExpression, self).__init__()
|
super().__init__()
|
||||||
|
|
||||||
# Check if current token matches the operators given from parameter
|
# Check if current token matches the operators given from parameter
|
||||||
def _IsOperator(self, OpSet):
|
def _IsOperator(self, OpSet):
|
||||||
@ -324,7 +324,7 @@ class ValueExpression(BaseExpression):
|
|||||||
return Val
|
return Val
|
||||||
|
|
||||||
def __init__(self, Expression, SymbolTable={}):
|
def __init__(self, Expression, SymbolTable={}):
|
||||||
super(ValueExpression, self).__init__(self, Expression, SymbolTable)
|
super().__init__(self, Expression, SymbolTable)
|
||||||
self._NoProcess = False
|
self._NoProcess = False
|
||||||
if not isinstance(Expression, type('')):
|
if not isinstance(Expression, type('')):
|
||||||
self._Expr = Expression
|
self._Expr = Expression
|
||||||
|
@ -347,7 +347,7 @@ class RangeExpression(BaseExpression):
|
|||||||
|
|
||||||
|
|
||||||
def __init__(self, Expression, PcdDataType, SymbolTable = {}):
|
def __init__(self, Expression, PcdDataType, SymbolTable = {}):
|
||||||
super(RangeExpression, self).__init__(self, Expression, PcdDataType, SymbolTable)
|
super().__init__(self, Expression, PcdDataType, SymbolTable)
|
||||||
self._NoProcess = False
|
self._NoProcess = False
|
||||||
if not isinstance(Expression, type('')):
|
if not isinstance(Expression, type('')):
|
||||||
self._Expr = Expression
|
self._Expr = Expression
|
||||||
|
@ -166,7 +166,7 @@ class StructurePcd(PcdClassObject):
|
|||||||
expressions = []
|
expressions = []
|
||||||
if Packages is None:
|
if Packages is None:
|
||||||
Packages = []
|
Packages = []
|
||||||
super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, validlists, expressions)
|
super().__init__(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, validlists, expressions)
|
||||||
self.StructuredPcdIncludeFile = [] if StructuredPcdIncludeFile is None else StructuredPcdIncludeFile
|
self.StructuredPcdIncludeFile = [] if StructuredPcdIncludeFile is None else StructuredPcdIncludeFile
|
||||||
self.PackageDecs = Packages
|
self.PackageDecs = Packages
|
||||||
self.DefaultStoreName = [default_store]
|
self.DefaultStoreName = [default_store]
|
||||||
|
@ -139,7 +139,7 @@ class MetaFileParser(object):
|
|||||||
if FilePath in Class.MetaFiles:
|
if FilePath in Class.MetaFiles:
|
||||||
return Class.MetaFiles[FilePath]
|
return Class.MetaFiles[FilePath]
|
||||||
else:
|
else:
|
||||||
ParserObject = super(MetaFileParser, Class).__new__(Class)
|
ParserObject = super().__new__(Class)
|
||||||
Class.MetaFiles[FilePath] = ParserObject
|
Class.MetaFiles[FilePath] = ParserObject
|
||||||
return ParserObject
|
return ParserObject
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ from Common.BuildToolError import BUILD_ERROR
|
|||||||
|
|
||||||
class OrderedListDict(OrderedDict):
|
class OrderedListDict(OrderedDict):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(OrderedListDict, self).__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.default_factory = list
|
self.default_factory = list
|
||||||
|
|
||||||
def __missing__(self, key):
|
def __missing__(self, key):
|
||||||
|
Reference in New Issue
Block a user