Skip to content

Commit

Permalink
run linting and import sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
LBlend committed Jan 14, 2025
1 parent 3559156 commit 5655ade
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cogs/botinfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os import environ, getpid
import platform
from os import environ, getpid
from time import time

import discord
Expand Down
2 changes: 1 addition & 1 deletion src/cogs/dev_tools.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import asyncio
from os import listdir
import requests

import discord
import requests
from discord.ext import commands

from cogs.utils import embed_templates
Expand Down
2 changes: 1 addition & 1 deletion src/cogs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from discord.ext import commands
from iso3166 import countries

from cogs.utils import embed_templates
import cogs.utils.database as database
from cogs.utils import embed_templates
from cogs.utils.osu_api import Gamemode, OsuApi


Expand Down
2 changes: 1 addition & 1 deletion src/cogs/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from discord import app_commands
from discord.ext import commands, tasks

from cogs.utils import embed_templates
import cogs.utils.database as database
from cogs.utils import embed_templates
from cogs.utils.osu_api import Gamemode, GamemodeOptions, OsuApi


Expand Down
6 changes: 5 additions & 1 deletion src/cogs/utils/database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import annotations
from abc import abstractmethod
from dataclasses import astuple, dataclass
from datetime import datetime
Expand Down Expand Up @@ -71,6 +70,7 @@ def init_db(self) -> None:
async def get_version(self) -> str:
"""
Fetches the database server version number
Returns
----------
str: The database driver name and its version number
Expand All @@ -91,9 +91,11 @@ def __init__(self, table_name: str, dataclass: dataclass, create_row_on_none: bo
async def get(self, discord_id: int) -> dataclass:
"""
Fetches a row from the database
Parameters
----------
discord_id (int): The Discord ID
Returns
----------
dataclass: A dataclass object
Expand All @@ -117,6 +119,7 @@ async def get(self, discord_id: int) -> dataclass:
async def get_all(self) -> tuple[dataclass]:
"""
Fetches all the rows from the database
Returns
----------
tuple[dataclass]: A tuple of dataclass objects
Expand All @@ -142,6 +145,7 @@ async def count(self) -> int:
async def save(self, data: dataclass) -> None:
"""
Saves a row to the database
Parameters
----------
data (dataclass): A dataclass object
Expand Down
1 change: 1 addition & 0 deletions src/cogs/utils/misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def ignore_exception(*exceptions: Exception):
"""
Ignores the given exceptions
Parameters
----------
*exceptions tuple[Exception]: The exceptions you want to ignore
Expand Down
5 changes: 3 additions & 2 deletions src/cogs/utils/osu_api.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from __future__ import annotations

import uuid
from codecs import open
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from enum import Enum
import uuid

import aiohttp
import discord
from expiringdict import ExpiringDict
import yaml
from expiringdict import ExpiringDict

from . import database

Expand Down
5 changes: 2 additions & 3 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
from time import time

import discord
from discord.ext import commands
import yaml
import uvicorn
import yaml
from discord.ext import commands

import cogs.utils.database as database
from logger import BotLogger


with open('./src/config/config.yaml', 'r', encoding='utf8') as f:
config = yaml.load(f, Loader=yaml.SafeLoader)

Expand Down
1 change: 1 addition & 0 deletions src/verification_server/server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

sys.path.append('..') # Allow to share the same database abstractions and connection

from fastapi import FastAPI, Request # noqa E402
Expand Down

0 comments on commit 5655ade

Please sign in to comment.