diff --git a/common.py b/common.py index 858e25a..01fe0c6 100644 --- a/common.py +++ b/common.py @@ -72,15 +72,6 @@ paths = SimpleNamespace( # --- Classes --- -class CallsignInfoData: - """Represents a country's callsign info""" - def __init__(self, data: list): - self.title: str = data[0] - self.desc: str = data[1] - self.calls: str = data[2] - self.emoji: str = data[3] - - class ImageMetadata: """Represents the metadata of a single image.""" def __init__(self, metadata: list): diff --git a/resources/callsign_info.py b/resources/callsign_info.py index 860afae..81d9075 100644 --- a/resources/callsign_info.py +++ b/resources/callsign_info.py @@ -7,12 +7,22 @@ This file is part of discord-qrmbot and is released under the terms of the GNU General Public License, version 2. """ + +from dataclasses import dataclass + from .callsigninfos import (us, ca) -from common import CallsignInfoData -# format: country: (title, description, text) +@dataclass +class CallsignInfoData: + """Represents a country's callsign info""" + title: str = "" + desc: str = "" + calls: str = "" + emoji: str = "" + + options = { - "us": CallsignInfoData([us.title, us.desc, us.calls, us.emoji]), - "ca": CallsignInfoData([ca.title, ca.desc, ca.calls, ca.emoji]), + "us": CallsignInfoData(us.title, us.desc, us.calls, us.emoji), + "ca": CallsignInfoData(ca.title, ca.desc, ca.calls, ca.emoji), }