Skip to content

Commit

Permalink
style(gen): fix get_property_definitions code style
Browse files Browse the repository at this point in the history
  • Loading branch information
JGrothoff committed Nov 8, 2024
1 parent 894643d commit 3f51014
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pdf2aas/generator/aas_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def get_property(self, id_: str) -> Property | None:
property_, _ = self._properties.get(id_, (None, None))
return property_

def get_property_definitions(self, overwrite_dataspec: bool = False) -> list[PropertyDefinition]:
def get_property_definitions(
self, *, overwrite_dataspec: bool = False,
) -> list[PropertyDefinition]:
"""Derive the property definition from the properties found in the template."""
definitions = []
for property_, _ in self._properties.values():
Expand All @@ -141,7 +143,11 @@ def get_property_definitions(self, overwrite_dataspec: bool = False) -> list[Pro
definition.name = {}
else:
definition.name = {property_.language: property_.label}
if definition.definition is None or len(definition.definition) == 0 or overwrite_dataspec:
if (
definition.definition is None
or len(definition.definition) == 0
or overwrite_dataspec
):
if property_.reference is None or len(property_.reference) == 0:
definition.definition = {}
else:
Expand Down

0 comments on commit 3f51014

Please sign in to comment.