move CallsignInfoData to resources/callsign_info (#258)

fixes #255
This commit is contained in:
classabbyamp 2020-10-28 21:04:14 -04:00 committed by GitHub
parent f26a7af928
commit 2eea7dce23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -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):

View File

@ -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),
}