diff options
| author | Cody Logan <cody@lokken.dev> | 2023-12-01 15:33:21 -0800 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-12-01 15:33:21 -0800 |
| commit | 318d9ad1a4679832b380c77ab1a0a86684f686f2 (patch) | |
| tree | ee1bd8ad347c18b3fc44da388360634c3afd231c /src/wikiget/file.py | |
| parent | 488e859f8c343b0ef25db379b6339bf82769514b (diff) | |
| download | wikiget-318d9ad1a4679832b380c77ab1a0a86684f686f2.tar.gz wikiget-318d9ad1a4679832b380c77ab1a0a86684f686f2.zip | |
Switch to Google-style docstrings for readability
The previous Sphinx-style docstrings could be hard to read at a
glance when formatted with pydoc.
Diffstat (limited to 'src/wikiget/file.py')
| -rw-r--r-- | src/wikiget/file.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/wikiget/file.py b/src/wikiget/file.py index 0b0c1e0..69597f2 100644 --- a/src/wikiget/file.py +++ b/src/wikiget/file.py @@ -40,15 +40,14 @@ class File: will be used as the output name, and if no site is given, the default site will be used (commons.wikimedia.org). - :param name: name of the file - :type name: str - :param dest: output name of the file; if not specified, defaults to name - :type dest: str, optional - :param site: name of the site hosting the file; if not specified, defaults to - the global default site - :type site: str, optional - :param image: mwclient image object retrieved from the host site - :type image: mwclient.image.Image, optional + Args: + name (str): name of the file + dest (str, optional): output name of the file; defaults to the value given + to name + site (str, optional): name of the site hosting the file; defaults to the + global default site + image (mwclient.image.Image): mwclient image object retrieved from the host + site """ self.name = name self.dest = Path(dest) if dest else Path(name) @@ -58,10 +57,11 @@ class File: def __eq__(self, other: object) -> bool: """Compare this File object with another for equality. - :param other: another File to compare - :type other: wikiget.file.File - :return: True if the Files are equal and False otherwise - :rtype: bool + Args: + other (wikiget.file.File): another File to compare + + Returns: + bool: True if the Files are equal and False otherwise """ if not isinstance(other, File): return NotImplemented @@ -75,16 +75,16 @@ class File: def __str__(self) -> str: """Return a basic string representation of this class, for str(). - :return: string form of the class - :rtype: str + Returns: + str: string form of the class """ return str(self.__dict__) def __repr__(self) -> str: """Return a formal string representation of this class, for repr(). - :return: string form of the class - :rtype: str + Returns: + str: string form of the class """ attr_list = [self.name, self.dest, self.site] return '{}("{}", {})'.format( |
