better debug information

This commit is contained in:
Emmanuel Garette 2021-03-19 10:31:29 +01:00
parent e66a462710
commit 1e6c9060b5

View file

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