Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Deuchnord committed Feb 17, 2024
1 parent 6132e82 commit f0b2b3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions f2ap/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def __init__(
private_key: str,
display_name: str = None,
summary: str = None,
avatar: str|None = None,
header: str|None = None,
avatar: str | None = None,
header: str | None = None,
followings: [str] = None,
attachments: {str: str} = None,
):
Expand Down
14 changes: 11 additions & 3 deletions f2ap/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Attachment(BaseModel):

class PropertyValueAttachment(Attachment):
def __init__(self, name: str, value: str):
super().__init__(type='PropertyValue', name=name, value=value)
super().__init__(type="PropertyValue", name=name, value=value)


class PublicKey(BaseModel):
Expand Down Expand Up @@ -150,8 +150,16 @@ def make(cls, actor: ConfigActor):
preferredUsername=actor.preferred_username,
name=actor.display_name,
summary=str(Markdown(actor.summary)),
icon=ImageFile.from_file(actor.avatar, f"{actor.id}/avatar") if actor.avatar is not None else None,
image=ImageFile.from_file(actor.header, f"{actor.id}/header") if actor.header is not None else None,
icon=(
ImageFile.from_file(actor.avatar, f"{actor.id}/avatar")
if actor.avatar is not None
else None
),
image=(
ImageFile.from_file(actor.header, f"{actor.id}/header")
if actor.header is not None
else None
),
attachment=cls.make_attachments(actor.attachments),
following=f"{actor.id}/following",
followers=f"{actor.id}/followers",
Expand Down

0 comments on commit f0b2b3d

Please sign in to comment.