diff --git a/src/rougail/template/base.py b/src/rougail/template/base.py index 83c5a3cf..66aaa661 100644 --- a/src/rougail/template/base.py +++ b/src/rougail/template/base.py @@ -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,