This commit is contained in:
Lex Berezhny 2020-02-07 18:44:30 -05:00
parent db25f3282e
commit 6fbbf36143

View file

@ -52,7 +52,7 @@ class ErrorClass:
def get_arguments(self): def get_arguments(self):
args = ['self'] args = ['self']
for arg in re.findall('{([a-z0-1_\(\)]+)}', self.message): for arg in re.findall('{([a-z0-1_()]+)}', self.message):
for func in FUNCTIONS: for func in FUNCTIONS:
if arg.startswith(f'{func}('): if arg.startswith(f'{func}('):
arg = arg[len(f'{func}('):-1] arg = arg[len(f'{func}('):-1]
@ -60,7 +60,8 @@ class ErrorClass:
args.append(arg) args.append(arg)
return args return args
def get_fields(self, args): @staticmethod
def get_fields(args):
if len(args) > 1: if len(args) > 1:
return f''.join(f'\n{INDENT*2}self.{field} = {field}' for field in args[1:]) return f''.join(f'\n{INDENT*2}self.{field} = {field}' for field in args[1:])
return '' return ''