Skip to content

Commit

Permalink
Fix docstrings + minor nits
Browse files Browse the repository at this point in the history
  • Loading branch information
scrazzz committed Jan 31, 2024
1 parent b38f494 commit f62dc4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions redgifs/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from enum import Enum

__all__ = ('Order', 'Type')

class Order(Enum):
"""An enum representing the Order."""

Expand Down
12 changes: 6 additions & 6 deletions redgifs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class URL:
The poster URL of the GIF.
thumbnail: :class:`str`
The thumbnail URL of the GIF.
vthumbnail: :class:`str`
vthumbnail: Optional[:class:`str`]
The vthumbnail URL of the GIF.
web_url: :class:`str`
The website URL of the GIF.
Expand Down Expand Up @@ -86,9 +86,9 @@ class GIF:
A list of tags for the GIF.
verified: :class:`bool`
Wheather the publisher of the GIF is a verified creator.
views: :class:`int`
views: Optional[:class:`int`]
The amount of views for the GIF.
duration: :class:`int`
duration: :class:`float`
The GIF's duration in seconds.
published: :class:`bool`
Wheather the GIF is published.
Expand Down Expand Up @@ -146,7 +146,7 @@ class Image:
A list of tags for the GIF.
verified: :class:`bool`
Wheather the publisher of the image is a verified creator.
views: :class:`int`
views: Optional[:class:`int`]
The amount of views the image has.
published: :class:`bool`
Wheather the image is published.
Expand Down Expand Up @@ -204,11 +204,11 @@ class User:
profile_url: :class:`str`
The user's "profile URL".
This is NOT the user's URL on ``redgifs.com``, see :py:attr:`url <redgifs.models.User.url>` for that.
published_collections: :class:`int`
published_collections: Optional[:class:`int`]
The user's amount of published collections.
published_gifs: :class:`int`
The user's amount of published GIFs.
status: :class:`str`
status: Optional[:class:`str`]
The user's status.
subscription: :class:`int`
Expand Down
2 changes: 1 addition & 1 deletion redgifs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def build_file_url(url: str) -> str:

def _read_tags_json() -> Dict[str, str]:
file_ = pkgutil.get_data(__name__, 'tags.json')
return json.loads(file_) # type: ignore - same reason above
return json.loads(file_) # type: ignore - file_ will never be None

async def _async_read_tags_json() -> Dict[str, str]:
r = await asyncio.get_event_loop().run_in_executor(None, _read_tags_json)
Expand Down

0 comments on commit f62dc4d

Please sign in to comment.