Renamed to DakinySettings. Converted dataclass to YAMLWizard.
build_develop / build (push) Failing after 17s

This commit is contained in:
2024-09-03 14:37:06 -04:00
parent b15e99ca68
commit 62f53bde55
14 changed files with 76 additions and 58 deletions
+9 -9
View File
@@ -12,7 +12,7 @@ import nextcord
from sqlalchemy import select, true, update
from sqlalchemy.orm import Session
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
from database_setup.sql_data_classes import (
CouncilMembers,
EventPoints,
@@ -57,7 +57,7 @@ def get_datetime(day: str) -> datetime:
return datetime(year, month, day, tzinfo=UTC)
def get_election_name(config: DakinyConfig) -> str:
def get_election_name(config: DakinySettings) -> str:
"""
Builds the unique name of the current election cycle.
@@ -72,7 +72,7 @@ def get_election_name(config: DakinyConfig) -> str:
return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
def get_quarter_name(config: DakinyConfig) -> str:
def get_quarter_name(config: DakinySettings) -> str:
"""
Builds the name of the current cycle/quarter.
@@ -88,7 +88,7 @@ def get_quarter_name(config: DakinyConfig) -> str:
return f"{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
def get_current_election_cycle(config: DakinyConfig) -> int:
def get_current_election_cycle(config: DakinySettings) -> int:
"""
Returns index for active election. An election is considered active between the election start and the term start.
@@ -111,7 +111,7 @@ def get_current_election_cycle(config: DakinyConfig) -> int:
return get_quarter_cycle(config)
def get_quarter_cycle(config: DakinyConfig) -> int:
def get_quarter_cycle(config: DakinySettings) -> int:
"""
Returns the index for the current cycle/quarter. Defined as between term start and end. Shouldn't return none.
@@ -132,7 +132,7 @@ def get_quarter_cycle(config: DakinyConfig) -> int:
return None
def build_votes_str(config: DakinyConfig, guild: nextcord.Guild) -> str:
def build_votes_str(config: DakinySettings, guild: nextcord.Guild) -> str:
"""
Creates a string that contains all nominees and their votes to be sent as a discord message.
@@ -168,7 +168,7 @@ def build_votes_str(config: DakinyConfig, guild: nextcord.Guild) -> str:
return votes_str
def build_highcouncil_votes_str(config: DakinyConfig, guild: nextcord.Guild) -> str:
def build_highcouncil_votes_str(config: DakinySettings, guild: nextcord.Guild) -> str:
"""
Creates a string that contains all high council nominees and their votes to be sent as a discord message.
@@ -302,7 +302,7 @@ def decorate_dm_nomination(user_id: int, speech: str) -> str:
return msg
def record_event_points(config: DakinyConfig, users: Sequence[str], add_points: int, *, is_member: bool) -> None:
def record_event_points(config: DakinySettings, users: Sequence[str], add_points: int, *, is_member: bool) -> None:
"""
Adds event points to all users listed.
@@ -502,7 +502,7 @@ async def edit_clan_message(
session.commit()
async def edit_clan_council_info(guild: nextcord.Guild, config: DakinyConfig) -> None:
async def edit_clan_council_info(guild: nextcord.Guild, config: DakinySettings) -> None:
"""
Gets the winners of the elections and updates the permanent message that states the current council.