From cbff3dd1a3d9c631aa2989a11a9d790e952a9c00 Mon Sep 17 00:00:00 2001 From: wwakabobik Date: Fri, 24 Nov 2023 17:29:06 +0100 Subject: [PATCH] v0.4 --- examples/image_generation/image_test.py | 6 +++--- examples/llm_api_comparison/wrapped_llm_test.py | 2 +- pyproject.toml | 2 +- utils/discord_interactions.py | 2 +- utils/discord_watcher.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/image_generation/image_test.py b/examples/image_generation/image_test.py index 4cbe527..d90fd4b 100644 --- a/examples/image_generation/image_test.py +++ b/examples/image_generation/image_test.py @@ -18,9 +18,9 @@ from pprint import pprint from urllib.parse import unquote +import asyncio import aiofiles import aiohttp -import asyncio from ablt_python_api import ABLTApi_async as ABLTApi from leonardo_api import LeonardoAsync as Leonardo from openai_python_api.dalle import DALLE @@ -98,7 +98,7 @@ def find_and_clear(log_file): :rtype: str """ for _ in range(12): - with open(log_file, "r+") as file: + with open(log_file, "r+", encoding="utf-8") as file: lines = file.readlines() for line in reversed(lines): match = re.search(r"Found an attachment: (.*)", line) @@ -131,7 +131,7 @@ async def save_image_from_url(url, file_path): return None -async def generate_image(): +async def generate_image(): # pylint: disable=too-many-locals """ Generate image. diff --git a/examples/llm_api_comparison/wrapped_llm_test.py b/examples/llm_api_comparison/wrapped_llm_test.py index 46a481d..147c87e 100644 --- a/examples/llm_api_comparison/wrapped_llm_test.py +++ b/examples/llm_api_comparison/wrapped_llm_test.py @@ -50,7 +50,7 @@ def main(): save_to_csv(file_name="llm_wrapped.csv", model_name=model, question=prompt, metrics=response) error_counter = 5 break - except Exception as error: + except Exception as error: # pylint: disable=broad-except if error_counter == 0: print("Broken API? Skipping...") break diff --git a/pyproject.toml b/pyproject.toml index 78b1e78..c7bf75d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ extend-ignore = """ I004, WPS110, WPS420, - C812 + C812, """ [tool.pylint] diff --git a/utils/discord_interactions.py b/utils/discord_interactions.py index 5214e5a..aa58655 100644 --- a/utils/discord_interactions.py +++ b/utils/discord_interactions.py @@ -14,7 +14,7 @@ import aiohttp -class DiscordInteractions: +class DiscordInteractions: # pylint: disable=too-few-public-methods """Discord interactions to python API.""" def __init__(self, token, **kwargs): diff --git a/utils/discord_watcher.py b/utils/discord_watcher.py index c70d0a6..332dd42 100644 --- a/utils/discord_watcher.py +++ b/utils/discord_watcher.py @@ -18,7 +18,7 @@ from utils.logger_config import setup_logger -class DiscordWatcher(commands.Bot, ABC): +class DiscordWatcher(commands.Bot, ABC): # pylint: disable=too-many-ancestors """Discord bot watcher for getting messages (images, urls, embeds) from a specific user.""" def __init__(self, watch_user_id=None, **options):