Skip to content
Snippets Groups Projects
Commit 03df5e1a authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: key error in debug

parent 3fbdae7e
No related branches found
No related tags found
2 merge requests!91Release 0.3,!87WIP: lots of changes
Pipeline #33006 passed
...@@ -418,7 +418,7 @@ class Converter(object, metaclass=ABCMeta): ...@@ -418,7 +418,7 @@ class Converter(object, metaclass=ABCMeta):
def inner(self, element: StructureElement): def inner(self, element: StructureElement):
mr = func(self, element) mr = func(self, element)
if "debug_match" in self.definition and self.definition["debug_match"]: if "debug_match" in self.definition and self.definition["debug_match"]:
if kind == "name": if kind == "name" and "match" in self.definition:
self._debug_matching_template(name=self.__class__.__name__, self._debug_matching_template(name=self.__class__.__name__,
regexp=[self.definition["match"]], regexp=[self.definition["match"]],
matched=[element.name], matched=[element.name],
...@@ -430,14 +430,16 @@ class Converter(object, metaclass=ABCMeta): ...@@ -430,14 +430,16 @@ class Converter(object, metaclass=ABCMeta):
if "match" in self.definition else "", if "match" in self.definition else "",
self.definition["match_name"] self.definition["match_name"]
if "match_name" in self.definition else "", if "match_name" in self.definition else "",
self.definition["match_value"]], self.definition["match_value"]
if "match_value" in self.definition else ""],
matched=[element.name, element.name, str(element.value)], matched=[element.name, element.name, str(element.value)],
result=mr) result=mr)
else: else:
self._debug_matching_template(name=self.__class__.__name__, self._debug_matching_template(name=self.__class__.__name__,
regexp=self.definition["match"], regexp=self.definition["match"]
if "match" in self.definition else "",
matched=str(element), matched=str(element),
result=result) result=mr)
return mr return mr
return inner return inner
return debug_matching_decorator return debug_matching_decorator
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment