Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
WitherredAway committed Apr 17, 2022
1 parent dfb1da1 commit f38d760
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions gists/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
class File:
"""The file object that is provided when editing and creating gists"""

def __init__(self, *, name: str, content: Optional[str] = None, new_name: Optional[str] = None):
def __init__(
self,
*,
name: str,
content: Optional[str] = None,
new_name: Optional[str] = None
):
self.name: str = name
self.content: str = content

Expand All @@ -19,16 +25,12 @@ def __init__(self, *, name: str, content: Optional[str] = None, new_name: Option
def to_dict(self) -> typing.Dict:
"""Returns the dictionary form of the File object"""

files_dict = {
self.name: {
"filename": self.new_name
}
}
files_dict = {self.name: {"filename": self.new_name}}

if self.content:
content_dict = {"content": self.content}
files_dict[self.name].update(content_dict)

return files_dict

@classmethod
Expand Down

0 comments on commit f38d760

Please sign in to comment.