From a467b78c7b4ec6115ce2801f4bbcb37cc2473fbc Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Fri, 23 Oct 2020 14:20:17 -0300 Subject: [PATCH 1/6] Remove f-string. --- ksoftapi/apis/images.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ksoftapi/apis/images.py b/ksoftapi/apis/images.py index 2e68f8a..e35b6ad 100644 --- a/ksoftapi/apis/images.py +++ b/ksoftapi/apis/images.py @@ -120,7 +120,7 @@ async def get_image(self, snowflake: str) -> Image: ------- :class:`Image` """ - r = await self._client.http.get(f'/images/image/{snowflake}') + r = await self._client.http.get('/images/image/{}'.format(snowflake)) if r.get('code', 200) == 404: raise NoResults @@ -149,12 +149,12 @@ async def search_tags(self, search: str) -> TagCollection: async def random_nsfw(self, gifs: bool = False) -> RedditImage: """|coro| - This function gets an random nsfw image. + This function gets a random nsfw image. Parameters ---------- gifs: :class:`bool` - If gifs should be retrivied instead of images. + If gifs should be returned instead of images. Returns ------- From 0acb5261e7edd899f702258c941a03c6ca5a762d Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Fri, 23 Oct 2020 14:25:12 -0300 Subject: [PATCH 2/6] Bump version. --- ksoftapi/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ksoftapi/__init__.py b/ksoftapi/__init__.py index 7622626..8b4caa9 100644 --- a/ksoftapi/__init__.py +++ b/ksoftapi/__init__.py @@ -8,7 +8,7 @@ __author__ = 'AndyTempel' __license__ = 'GNU' __copyright__ = 'Copyright 2018-2020 AndyTempel' -__version__ = '0.3.0a' +__version__ = '0.3.1a' import logging from collections import namedtuple @@ -19,7 +19,7 @@ VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial') -version_info = VersionInfo(major=0, minor=3, micro=0, releaselevel='alpha', serial=0) +version_info = VersionInfo(major=0, minor=3, micro=1, releaselevel='alpha', serial=0) try: from logging import NullHandler From c1d95f3642c080c5d0c89a8dc72f2c8313502a45 Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Fri, 23 Oct 2020 16:32:39 -0300 Subject: [PATCH 3/6] Add url to LyricResult model. --- ksoftapi/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ksoftapi/models.py b/ksoftapi/models.py index adf953c..3c6c46d 100644 --- a/ksoftapi/models.py +++ b/ksoftapi/models.py @@ -59,6 +59,7 @@ def __init__(self, data: dict): self.popularity: int = data['popularity'] self.id: str = data['id'] self.search_score: float = data['search_score'] + self.url: str = data['url'] class PaginatorListing: From c7e718b2d7167a90ff7933ec8d867d7d3ed85635 Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Sat, 31 Oct 2020 18:30:37 -0300 Subject: [PATCH 4/6] Add "raw" attribute to the models. --- ksoftapi/models.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ksoftapi/models.py b/ksoftapi/models.py index 3c6c46d..5513227 100644 --- a/ksoftapi/models.py +++ b/ksoftapi/models.py @@ -16,6 +16,7 @@ def __init__(self, data: dict): self.appeal_date: Optional[str] = data['appeal_date'] self.requested_by: str = data['requested_by'] self.exists: bool = data['exists'] + self.raw: dict = data class BanSimple: @@ -25,6 +26,7 @@ def __init__(self, data: dict): self.proof: str = data['proof'] self.moderator_id: str = data['moderator_id'] self.active: bool = data['is_ban_active'] + self.raw: dict = data class Image: @@ -33,6 +35,7 @@ def __init__(self, data: dict): self.snowflake: str = data['snowflake'] self.nsfw: bool = data['nsfw'] self.tag: str = data['tag'] + self.raw: dict = data class Location: @@ -44,6 +47,8 @@ def __init__(self, data: dict): self.type: List[str] = data['type'] self.map: Optional[str] = data.get('map') + self.raw: dict = data + class LyricResult: def __init__(self, data: dict): @@ -61,6 +66,8 @@ def __init__(self, data: dict): self.search_score: float = data['search_score'] self.url: str = data['url'] + self.raw: dict = data + class PaginatorListing: def __init__(self, data: dict): @@ -72,6 +79,7 @@ def __init__(self, data: dict): self.next_page: Optional[int] = data['next_page'] self.previous_page: Optional[int] = data['previous_page'] self.data: List[BanInfo] = [BanInfo(ban) for ban in data['data']] + self.raw: dict = data class Recommendation: @@ -99,6 +107,7 @@ def __init__(self, data: dict): for artist in spotify_artists ] + self.raw: dict = data class RedditImage: def __init__(self, data: dict): @@ -113,12 +122,16 @@ def __init__(self, data: dict): self.created_at: int = data.get('created_at') self.nsfw: bool = data.get('nsfw') + self.raw: dict = data + class Tag: def __init__(self, data: dict): self.name: str = data.get('name') self.nsfw: bool = data.get('nsfw') + self.raw: dict = data + def __str__(self): return self.name @@ -130,6 +143,8 @@ def __init__(self, data: dict): self.sfw_tags: List[str] = data.get('tags') self.nsfw_tags: List[str] = data.get('nsfw_tags', []) + self.raw: dict = data + def __len__(self): return len(self.models) @@ -156,3 +171,5 @@ def __init__(self, data: dict): self.title: str = data.get('title') self.nsfw: bool = data.get('nsfw') self.article_url: str = data.get('article_url') + + self.raw: dict = data From ef07c99c85ffd4b4e583ac4a3309a93c57f902a8 Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Sat, 31 Oct 2020 18:33:47 -0300 Subject: [PATCH 5/6] Fix pep8. Idk it passed here. --- ksoftapi/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ksoftapi/models.py b/ksoftapi/models.py index 5513227..fa6abd7 100644 --- a/ksoftapi/models.py +++ b/ksoftapi/models.py @@ -109,6 +109,7 @@ def __init__(self, data: dict): self.raw: dict = data + class RedditImage: def __init__(self, data: dict): self.author: str = data.get('author') From 3b7f11e4ff40c762fef2731ca9f16c774c5d04b6 Mon Sep 17 00:00:00 2001 From: uKaigo <37600692+uKaigo@users.noreply.github.com> Date: Mon, 9 Nov 2020 16:34:37 -0300 Subject: [PATCH 6/6] Drop support for <3.6 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index ab1b1f1..334d414 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ def get_requirements(): download_url=f'https://github.com/KSoft-Si/ksoftapi.py/archive/{version}.tar.gz', keywords=['ksoftapi'], install_requires=get_requirements(), + python_requires='>=3.6', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU General Public License (GPL)',