better debug information

This commit is contained in:
Emmanuel Garette 2021-03-19 10:31:29 +01:00
parent e66a462710
commit 1e6c9060b5
1 changed files with 6 additions and 3 deletions

View File

@ -166,11 +166,14 @@ class RougailExtra:
try: try:
return self.suboption[key] return self.suboption[key]
except KeyError: except KeyError:
raise AttributeError raise AttributeError(f'unable to find extra "{key}"')
def __iter__(self): def __iter__(self):
return iter(self.suboption.values()) return iter(self.suboption.values())
def items(self):
return self.suboption.items()
class RougailBaseTemplate: class RougailBaseTemplate:
"""Engine to process Creole cheetah template """Engine to process Creole cheetah template
@ -231,7 +234,7 @@ class RougailBaseTemplate:
def instance_file(self, def instance_file(self,
filevar: Dict, filevar: Dict,
type: str, type_: str,
service_name: str, service_name: str,
) -> None: ) -> None:
"""Run templatisation on one file """Run templatisation on one file
@ -253,7 +256,7 @@ class RougailBaseTemplate:
var = variable[idx] var = variable[idx]
else: else:
var = None var = None
func = f'_instance_{type}' func = f'_instance_{type_}'
data = getattr(self, func)(filevar, data = getattr(self, func)(filevar,
filename, filename,
service_name, service_name,