convert all OrderedDicts to dictionaries (#214)

Fixes #184

Co-authored-by: 0x5c <dev@0x5c.io>
This commit is contained in:
Abigail Gold 2020-03-30 22:54:33 +00:00 committed by GitHub
parent 6867c45c8c
commit bc93462c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 64 deletions

View File

@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- `?standards` command to display [xkcd 927](https://xkcd.com/927/).
### Changed
- Python>=3.7 now required.
## [2.2.3] - 2020-03-29

View File

@ -10,7 +10,6 @@ the GNU General Public License, version 2.
import random
import re
from collections import OrderedDict
from typing import Union
import discord
@ -189,7 +188,7 @@ class BaseCog(commands.Cog):
def parse_changelog():
changelog = OrderedDict()
changelog = {}
ver = ""
heading = ""

View File

@ -8,7 +8,6 @@ the GNU General Public License, version 2.
"""
from collections import OrderedDict
from io import BytesIO
import aiohttp
@ -159,27 +158,24 @@ def qrz_process_info(data: dict):
else:
lotw = "Unknown"
return OrderedDict([("Name", name),
("Country", data.get("country", None)),
("Address", address),
("Grid Square", data.get("grid", None)),
("County", data.get("county", None)),
("CQ Zone", data.get("cqzone", None)),
("ITU Zone", data.get("ituzone", None)),
("IOTA Designator", data.get("iota", None)),
("Expires", data.get("expdate", None)),
("Aliases", data.get("aliases", None)),
("Previous Callsign", data.get("p_call", None)),
("License Class", data.get("class", None)),
("Trustee", data.get("trustee", None)),
("eQSL?", eqsl),
("Paper QSL?", mqsl),
("LotW?", lotw),
("QSL Info", data.get("qslmgr", None)),
("CQ Zone", data.get("cqzone", None)),
("ITU Zone", data.get("ituzone", None)),
("IOTA Designator", data.get("iota", None)),
("Born", data.get("born", None))])
return {"Name": name,
"Country": data.get("country", None),
"Address": address,
"Grid Square": data.get("grid", None),
"County": data.get("county", None),
"CQ Zone": data.get("cqzone", None),
"ITU Zone": data.get("ituzone", None),
"IOTA Designator": data.get("iota", None),
"Expires": data.get("expdate", None),
"Aliases": data.get("aliases", None),
"Previous Callsign": data.get("p_call", None),
"License Class": data.get("class", None),
"Trustee": data.get("trustee", None),
"eQSL?": eqsl,
"Paper QSL?": mqsl,
"LotW?": lotw,
"QSL Info": data.get("qslmgr", None),
"Born": data.get("born", None)}
def setup(bot):

View File

@ -8,49 +8,48 @@ the GNU General Public License, version 2.
"""
from collections import OrderedDict
us_calls_title = "Valid US Vanity Callsigns"
us_calls_desc = ("#x# is the number of letters in the prefix and suffix of a callsign. "
"E.g., WY4RC would be a 2x2 callsign, with prefix WY and suffix RC.")
us_calls = OrderedDict([("**Group A** (Extra Only)", ("**Any:** K, N, W (1x2)\n"
" AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n"
" AA-AL (2x2)\n"
"*Except*\n"
"**Alaska:** AL, KL, NL, WL (2x1)\n"
"**Caribbean:** KP, NP, WP (2x1)\n"
"**Pacific:** AH, KH, NH, WH (2x1)")),
("**Group B** (Advanced and Extra Only)", ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n"
"*Except*\n"
"**Alaska:** AL (2x2)\n"
"**Caribbean:** KP (2x2)\n"
"**Pacific:** AH (2x2)")),
("**Group C** (Technician, General, Advanced, Extra Only)", ("**Any Region:** K, N, W (1x3)\n"
"*Except*\n"
"**Alaska:** KL, NL, WL (2x2)\n"
"**Caribbean:** NP, WP (2x2)\n"
"**Pacific:** KH, NH, WH (2x2)")),
("**Group D** (Any License Class)", ("**Any Region:** KA-KZ, WA-WZ (2x3)\n"
"*Except*\n"
"**Alaska:** KL, WL (2x3)\n"
"**Caribbean:** KP, WP (2x3)\n"
"**Pacific:** KH, WH (2x3)")),
("**Unavailable**", ("- KA2AA-KA9ZZ: US Army in Japan\n"
"- KC4AAA-KC4AAF: NSF in Antartica\n"
"- KC4USA-KC4USZ: US Navy in Antartica\n"
"- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n"
"- KL9KAA-KL9KHZ: US military in Korea\n"
"- KC6AA-KC6ZZ: Former US (Eastern and Western Caroline Islands), "
"now Federated States of Micronesia (V6) and Republic of Palau (T8)\n"
"- KX6AA-KX6ZZ: Former US (Marshall Islands), "
"now Republic of the Marshall Islands (V73)\n"
"- Any suffix SOS or QRA-QUZ\n"
"- Any 2x3 with X as the first suffix letter\n"
"- Any 2x3 with AF, KF, NF, or WF prefix and suffix EMA: FEMA\n"
"- Any 2x3 with AA-AL, NA-NZ, WC, WK, WM, WR, or WT prefix: \"Group X\"\n"
"- Any 2x1, 2x2, or 2x3 with KP, NP, WP prefix and 0, 6, 7, 8, 9 number\n"
"- Any 1x1 callsign: Special Event"))])
us_calls = {
"**Group A** (Extra Only)": ("**Any:** K, N, W (1x2)\n"
" AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n"
" AA-AL (2x2)\n"
"*Except*\n"
"**Alaska:** AL, KL, NL, WL (2x1)\n"
"**Caribbean:** KP, NP, WP (2x1)\n"
"**Pacific:** AH, KH, NH, WH (2x1)"),
"**Group B** (Advanced and Extra Only)": ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n"
"*Except*\n"
"**Alaska:** AL (2x2)\n"
"**Caribbean:** KP (2x2)\n"
"**Pacific:** AH (2x2)"),
"**Group C** (Technician, General, Advanced, Extra Only)": ("**Any Region:** K, N, W (1x3)\n"
"*Except*\n"
"**Alaska:** KL, NL, WL (2x2)\n"
"**Caribbean:** NP, WP (2x2)\n"
"**Pacific:** KH, NH, WH (2x2)"),
"**Group D** (Any License Class)": ("**Any Region:** KA-KZ, WA-WZ (2x3)\n"
"*Except*\n"
"**Alaska:** KL, WL (2x3)\n"
"**Caribbean:** KP, WP (2x3)\n"
"**Pacific:** KH, WH (2x3)"),
"**Unavailable**": ("- KA2AA-KA9ZZ: US Army in Japan\n"
"- KC4AAA-KC4AAF: NSF in Antartica\n"
"- KC4USA-KC4USZ: US Navy in Antartica\n"
"- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n"
"- KL9KAA-KL9KHZ: US military in Korea\n"
"- KC6AA-KC6ZZ: Former US (Eastern and Western Caroline Islands), "
"now Federated States of Micronesia (V6) and Republic of Palau (T8)\n"
"- KX6AA-KX6ZZ: Former US (Marshall Islands), "
"now Republic of the Marshall Islands (V73)\n"
"- Any suffix SOS or QRA-QUZ\n"
"- Any 2x3 with X as the first suffix letter\n"
"- Any 2x3 with AF, KF, NF, or WF prefix and suffix EMA: FEMA\n"
"- Any 2x3 with AA-AL, NA-NZ, WC, WK, WM, WR, or WT prefix: \"Group X\"\n"
"- Any 2x1, 2x2, or 2x3 with KP, NP, WP prefix and 0, 6, 7, 8, 9 number\n"
"- Any 1x1 callsign: Special Event")
}
# format: country: (title, description, text)
options = {"us": (us_calls_title, us_calls_desc, us_calls)}