Fix ruff smells in classes dir and config.py.
This commit is contained in:
+11
-12
@@ -1,27 +1,26 @@
|
||||
"""
|
||||
Contains various views to be used in the nomination process.
|
||||
"""
|
||||
"""Contains various views to be used in the 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_nomination, get_election_name
|
||||
|
||||
|
||||
class NominateModal(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__(
|
||||
@@ -78,9 +77,7 @@ class NominateModal(nextcord.ui.Modal):
|
||||
|
||||
|
||||
class NominateView(nextcord.ui.View):
|
||||
"""
|
||||
The button to press to start your nomination.
|
||||
"""
|
||||
"""The button to press to start your nomination."""
|
||||
|
||||
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
|
||||
super().__init__(timeout=None)
|
||||
@@ -92,8 +89,10 @@ class NominateView(nextcord.ui.View):
|
||||
style=nextcord.ButtonStyle.primary,
|
||||
custom_id="nominate",
|
||||
)
|
||||
async def nominate(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
|
||||
async def nominate(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None: # noqa: ARG002
|
||||
"""
|
||||
Button to nominate onself for Clan Council.
|
||||
|
||||
Gathers previous information about the user if they have already nominated themselves, then launches
|
||||
the nomination modal to get their speech.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user