Fix ruff smells in classes dir and config.py.

This commit is contained in:
2024-05-22 16:58:27 -04:00
parent e485c119f6
commit 6cd82dfcc4
6 changed files with 81 additions and 88 deletions
+18 -15
View File
@@ -1,14 +1,11 @@
"""
Contains various views to be used in the high council nomination process.
"""
"""Contains various views to be used in the high council nomination process."""
import nextcord
from config import DakinyConfig
from database_setup.sql_data_classes import CouncilMembers, engine
from nextcord.interactions import Interaction
from sqlalchemy import select
from sqlalchemy.orm import Session
from config import DakinyConfig
from database_setup.sql_data_classes import CouncilMembers, engine
from utils import (
NOMINEE_SPLITTER,
decorate_cl_nomination,
@@ -19,14 +16,16 @@ from utils import (
class NominateDMModal(nextcord.ui.Modal):
"""
Modal for nominating oneself. User writes a speech and then the callback sends the speech into the correct channel.
Modal for nominating oneself.
User writes a speech and then the callback sends the speech into the correct channel.
"""
def __init__(
self,
config: DakinyConfig,
usr_id: int,
usr_nominated: bool,
usr_nominated: bool, # noqa: FBT001
speech_content: str,
):
super().__init__(
@@ -79,14 +78,16 @@ class NominateDMModal(nextcord.ui.Modal):
class NominateCLModal(nextcord.ui.Modal):
"""
Modal for nominating oneself. User writes a speech and then the callback sends the speech into the correct channel.
Modal for nominating oneself.
User writes a speech and then the callback sends the speech into the correct channel.
"""
def __init__(
self,
config: DakinyConfig,
usr_id: int,
usr_nominated: bool,
usr_nominated: bool, # noqa: FBT001
speech_content: str,
):
super().__init__(
@@ -138,9 +139,7 @@ class NominateCLModal(nextcord.ui.Modal):
class NominateHighCouncilView(nextcord.ui.View):
"""
The buttons to press to start your High Council nomination.
"""
"""The buttons to press to start your High Council nomination."""
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
super().__init__(timeout=None)
@@ -152,8 +151,10 @@ class NominateHighCouncilView(nextcord.ui.View):
style=nextcord.ButtonStyle.primary,
custom_id="nominate-dm",
)
async def nominate_dm(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
async def nominate_dm(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None: # noqa: ARG002
"""
Button for nominating oneself for Discord Manager.
Gathers previous information about the user if they have already nominated themselves, then launches
the nomination modal to get their speech.
@@ -195,8 +196,10 @@ class NominateHighCouncilView(nextcord.ui.View):
style=nextcord.ButtonStyle.primary,
custom_id="nominate-cl",
)
async def nominate_cl(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
async def nominate_cl(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None: # noqa: ARG002
"""
Button for nominating oneself for Clan Leader.
Gathers previous information about the user if they have already nominated themselves, then launches
the nomination modal to get their speech.