Renamed to DakinySettings. Converted dataclass to YAMLWizard.
build_develop / build (push) Failing after 17s
build_develop / build (push) Failing after 17s
This commit is contained in:
+3
-3
@@ -9,7 +9,7 @@ from classes.nominate_highcouncil_views import NominateHighCouncilView
|
||||
from classes.nominate_views import NominateView
|
||||
from classes.voting_highcouncil_views import VoteHighcouncilView
|
||||
from classes.voting_views import VoteView
|
||||
from DakinyConfig import DakinyConfig
|
||||
from DakinySettings import DakinySettings
|
||||
from database_setup.sql_data_classes import (
|
||||
CouncilMembers,
|
||||
ElectionInformation,
|
||||
@@ -39,7 +39,7 @@ class Election:
|
||||
the cycle.
|
||||
"""
|
||||
|
||||
def __init__(self, cycle: int, config: DakinyConfig, guild: nextcord.Guild) -> None:
|
||||
def __init__(self, cycle: int, config: DakinySettings, guild: nextcord.Guild) -> None:
|
||||
"""
|
||||
Generates all dates relevant to the election cycle determined by the config and cycle.
|
||||
|
||||
@@ -48,7 +48,7 @@ class Election:
|
||||
config (DakinyConfig): The entire config object.
|
||||
guild (nextcord.Guild): The guild that this election is running in.
|
||||
"""
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.cycle = cycle
|
||||
self.election_cycle = self.config.election_cycles[self.cycle]
|
||||
self.election_start: datetime = get_datetime(self.election_cycle.election_start)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Contains various views to be used in the high council nomination process."""
|
||||
|
||||
import nextcord
|
||||
from DakinyConfig import DakinyConfig
|
||||
from DakinySettings import DakinySettings
|
||||
from database_setup.sql_data_classes import CouncilMembers, engine
|
||||
from nextcord.interactions import Interaction
|
||||
from sqlalchemy import select
|
||||
@@ -23,7 +23,7 @@ class NominateDMModal(nextcord.ui.Modal):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: DakinyConfig,
|
||||
config: DakinySettings,
|
||||
usr_id: int,
|
||||
usr_nominated: bool, # noqa: FBT001
|
||||
speech_content: str,
|
||||
@@ -33,7 +33,7 @@ class NominateDMModal(nextcord.ui.Modal):
|
||||
timeout=5 * 60, # 5 minutes
|
||||
)
|
||||
self.usr_id: int = usr_id
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.usr_nominated = usr_nominated
|
||||
|
||||
self.speech = nextcord.ui.TextInput(
|
||||
@@ -85,7 +85,7 @@ class NominateCLModal(nextcord.ui.Modal):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: DakinyConfig,
|
||||
config: DakinySettings,
|
||||
usr_id: int,
|
||||
usr_nominated: bool, # noqa: FBT001
|
||||
speech_content: str,
|
||||
@@ -95,7 +95,7 @@ class NominateCLModal(nextcord.ui.Modal):
|
||||
timeout=5 * 60, # 5 minutes
|
||||
)
|
||||
self.usr_id: int = usr_id
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.usr_nominated = usr_nominated
|
||||
|
||||
self.speech = nextcord.ui.TextInput(
|
||||
@@ -141,9 +141,9 @@ class NominateCLModal(nextcord.ui.Modal):
|
||||
class NominateHighCouncilView(nextcord.ui.View):
|
||||
"""The buttons to press to start your High Council nomination."""
|
||||
|
||||
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
|
||||
def __init__(self, config: DakinySettings, guild: nextcord.Guild):
|
||||
super().__init__(timeout=None)
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.guild: nextcord.Guild = guild
|
||||
|
||||
@nextcord.ui.button(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Contains various views to be used in the nomination process."""
|
||||
|
||||
import nextcord
|
||||
from DakinyConfig import DakinyConfig
|
||||
from DakinySettings import DakinySettings
|
||||
from database_setup.sql_data_classes import CouncilMembers, engine
|
||||
from nextcord.interactions import Interaction
|
||||
from sqlalchemy import select
|
||||
@@ -18,7 +18,7 @@ class NominateModal(nextcord.ui.Modal):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
config: DakinyConfig,
|
||||
config: DakinySettings,
|
||||
usr_id: int,
|
||||
usr_nominated: bool, # noqa: FBT001
|
||||
speech_content: str,
|
||||
@@ -28,7 +28,7 @@ class NominateModal(nextcord.ui.Modal):
|
||||
timeout=5 * 60, # 5 minutes
|
||||
)
|
||||
self.usr_id: int = usr_id
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.usr_nominated = usr_nominated
|
||||
|
||||
self.speech = nextcord.ui.TextInput(
|
||||
@@ -79,9 +79,9 @@ class NominateModal(nextcord.ui.Modal):
|
||||
class NominateView(nextcord.ui.View):
|
||||
"""The button to press to start your nomination."""
|
||||
|
||||
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
|
||||
def __init__(self, config: DakinySettings, guild: nextcord.Guild):
|
||||
super().__init__(timeout=None)
|
||||
self.config: DakinyConfig = config
|
||||
self.config: DakinySettings = config
|
||||
self.guild: nextcord.Guild = guild
|
||||
|
||||
@nextcord.ui.button(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Contains various views to be used while voting for high council. Controls the logic when performing the vote."""
|
||||
|
||||
import nextcord
|
||||
from DakinyConfig import DakinyConfig
|
||||
from DakinySettings import DakinySettings
|
||||
from database_setup.sql_data_classes import (
|
||||
CouncilMembers,
|
||||
ElectionInformation,
|
||||
@@ -18,7 +18,7 @@ from utils import VoteType, build_highcouncil_votes_str, get_election_name
|
||||
class VoteSelect(nextcord.ui.StringSelect):
|
||||
"""Vote view string select."""
|
||||
|
||||
def __init__(self, options: list["SelectOption"], config: DakinyConfig, election_type: str) -> None:
|
||||
def __init__(self, options: list["SelectOption"], config: DakinySettings, election_type: str) -> None:
|
||||
super().__init__(
|
||||
placeholder="Choose 1",
|
||||
min_values=1,
|
||||
@@ -83,7 +83,7 @@ class VoteSelect(nextcord.ui.StringSelect):
|
||||
class VoteHighcouncilView(nextcord.ui.View):
|
||||
"""The button to press to start voting for HighCouncil."""
|
||||
|
||||
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
|
||||
def __init__(self, config: DakinySettings, guild: nextcord.Guild):
|
||||
super().__init__(timeout=None)
|
||||
self.config = config
|
||||
self.guild = guild
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Contains various views to be used while voting. Controls the logic when performing the vote."""
|
||||
|
||||
import nextcord
|
||||
from DakinyConfig import DakinyConfig
|
||||
from DakinySettings import DakinySettings
|
||||
from database_setup.sql_data_classes import (
|
||||
CouncilMembers,
|
||||
ElectionInformation,
|
||||
@@ -18,7 +18,7 @@ from utils import VoteType, build_votes_str, get_election_name
|
||||
class VoteSelect(nextcord.ui.StringSelect):
|
||||
"""Vote view string select."""
|
||||
|
||||
def __init__(self, options: list["SelectOption"], config: DakinyConfig) -> None:
|
||||
def __init__(self, options: list["SelectOption"], config: DakinySettings) -> None:
|
||||
super().__init__(
|
||||
placeholder="Choose 1",
|
||||
min_values=1,
|
||||
@@ -79,7 +79,7 @@ class VoteSelect(nextcord.ui.StringSelect):
|
||||
class VoteView(nextcord.ui.View):
|
||||
"""The button to press to start your nomination."""
|
||||
|
||||
def __init__(self, config: DakinyConfig, guild: nextcord.Guild):
|
||||
def __init__(self, config: DakinySettings, guild: nextcord.Guild):
|
||||
super().__init__(timeout=None)
|
||||
self.config = config
|
||||
self.guild = guild
|
||||
|
||||
Reference in New Issue
Block a user