Skip to content

Commit

Permalink
Automated Black fmt fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Bot <[email protected]>
  • Loading branch information
Bot committed Aug 3, 2023
1 parent 3f49d81 commit 8808870
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions pydantic/langPack.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ def _set_instances(text, render):


def _lower_case_first_char(str):
return str[:1].lower() + str[1:] if str else ''
return str[:1].lower() + str[1:] if str else ""


def _set_lower_case(text, render):
return _lower_case_first_char(render(text))


# called by chevron, text contains the label {{dataType}}, which is evaluated by the renderer (see class template)
def _set_attribute(text, render):
attribute = eval(render(text))
Expand All @@ -99,19 +101,19 @@ def _set_default(attribute):
if multiplicity in ["M:1"] and multiplicity_by_name:
# Most probably there is a bug in the RDF that states multiplicity
# M:1 but should be M:1..N
return ' = Field(default=[], alias="'+attribute["label"]+'")'
return ' = Field(default=[], alias="' + attribute["label"] + '")'
if multiplicity in ["M:1", "M:1..1"]:
return ' = Field(alias="'+attribute["label"]+'")'
return ' = Field(alias="' + attribute["label"] + '")'
if multiplicity in ["M:0..1"]:
return ' = Field(default=None, alias="'+attribute["label"]+'")'
return ' = Field(default=None, alias="' + attribute["label"] + '")'
elif multiplicity in ["M:0..n"] or "M:0.." in multiplicity:
return ' = Field(default=[], alias="'+attribute["label"]+'")'
return ' = Field(default=[], alias="' + attribute["label"] + '")'
elif multiplicity in ["M:1..n"] or "M:1.." in multiplicity:
return ' = Field(default=[], alias="'+attribute["label"]+'")'
return ' = Field(default=[], alias="' + attribute["label"] + '")'
else:
return ' = Field(default=[], alias="'+attribute["label"]+'")'
return ' = Field(default=[], alias="' + attribute["label"] + '")'
else:
return ' = Field(alias="'+attribute["label"]+'")'
return ' = Field(alias="' + attribute["label"] + '")'


def _is_primitive(datatype):
Expand Down
2 changes: 1 addition & 1 deletion pydantic/schema_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PositionPoint(Base):
}
)

location: "Location" = Field(alias = "Location")
location: "Location" = Field(alias="Location")
sequenceNumber: Optional[int] = Field(default=None)
point: Point = Field(
repr=False
Expand Down

0 comments on commit 8808870

Please sign in to comment.