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] ## [Unreleased]
### Added ### Added
- `?standards` command to display [xkcd 927](https://xkcd.com/927/). - `?standards` command to display [xkcd 927](https://xkcd.com/927/).
### Changed
- Python>=3.7 now required.
## [2.2.3] - 2020-03-29 ## [2.2.3] - 2020-03-29

View File

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

View File

@ -8,7 +8,6 @@ the GNU General Public License, version 2.
""" """
from collections import OrderedDict
from io import BytesIO from io import BytesIO
import aiohttp import aiohttp
@ -159,27 +158,24 @@ def qrz_process_info(data: dict):
else: else:
lotw = "Unknown" lotw = "Unknown"
return OrderedDict([("Name", name), return {"Name": name,
("Country", data.get("country", None)), "Country": data.get("country", None),
("Address", address), "Address": address,
("Grid Square", data.get("grid", None)), "Grid Square": data.get("grid", None),
("County", data.get("county", None)), "County": data.get("county", None),
("CQ Zone", data.get("cqzone", None)), "CQ Zone": data.get("cqzone", None),
("ITU Zone", data.get("ituzone", None)), "ITU Zone": data.get("ituzone", None),
("IOTA Designator", data.get("iota", None)), "IOTA Designator": data.get("iota", None),
("Expires", data.get("expdate", None)), "Expires": data.get("expdate", None),
("Aliases", data.get("aliases", None)), "Aliases": data.get("aliases", None),
("Previous Callsign", data.get("p_call", None)), "Previous Callsign": data.get("p_call", None),
("License Class", data.get("class", None)), "License Class": data.get("class", None),
("Trustee", data.get("trustee", None)), "Trustee": data.get("trustee", None),
("eQSL?", eqsl), "eQSL?": eqsl,
("Paper QSL?", mqsl), "Paper QSL?": mqsl,
("LotW?", lotw), "LotW?": lotw,
("QSL Info", data.get("qslmgr", None)), "QSL Info": data.get("qslmgr", None),
("CQ Zone", data.get("cqzone", None)), "Born": data.get("born", None)}
("ITU Zone", data.get("ituzone", None)),
("IOTA Designator", data.get("iota", None)),
("Born", data.get("born", None))])
def setup(bot): 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_title = "Valid US Vanity Callsigns"
us_calls_desc = ("#x# is the number of letters in the prefix and suffix of a callsign. " 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.") "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" us_calls = {
" AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n" "**Group A** (Extra Only)": ("**Any:** K, N, W (1x2)\n"
" AA-AL (2x2)\n" " AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n"
"*Except*\n" " AA-AL (2x2)\n"
"**Alaska:** AL, KL, NL, WL (2x1)\n" "*Except*\n"
"**Caribbean:** KP, NP, WP (2x1)\n" "**Alaska:** AL, KL, NL, WL (2x1)\n"
"**Pacific:** AH, KH, NH, WH (2x1)")), "**Caribbean:** KP, NP, WP (2x1)\n"
("**Group B** (Advanced and Extra Only)", ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n" "**Pacific:** AH, KH, NH, WH (2x1)"),
"*Except*\n" "**Group B** (Advanced and Extra Only)": ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n"
"**Alaska:** AL (2x2)\n" "*Except*\n"
"**Caribbean:** KP (2x2)\n" "**Alaska:** AL (2x2)\n"
"**Pacific:** AH (2x2)")), "**Caribbean:** KP (2x2)\n"
("**Group C** (Technician, General, Advanced, Extra Only)", ("**Any Region:** K, N, W (1x3)\n" "**Pacific:** AH (2x2)"),
"*Except*\n" "**Group C** (Technician, General, Advanced, Extra Only)": ("**Any Region:** K, N, W (1x3)\n"
"**Alaska:** KL, NL, WL (2x2)\n" "*Except*\n"
"**Caribbean:** NP, WP (2x2)\n" "**Alaska:** KL, NL, WL (2x2)\n"
"**Pacific:** KH, NH, WH (2x2)")), "**Caribbean:** NP, WP (2x2)\n"
("**Group D** (Any License Class)", ("**Any Region:** KA-KZ, WA-WZ (2x3)\n" "**Pacific:** KH, NH, WH (2x2)"),
"*Except*\n" "**Group D** (Any License Class)": ("**Any Region:** KA-KZ, WA-WZ (2x3)\n"
"**Alaska:** KL, WL (2x3)\n" "*Except*\n"
"**Caribbean:** KP, WP (2x3)\n" "**Alaska:** KL, WL (2x3)\n"
"**Pacific:** KH, WH (2x3)")), "**Caribbean:** KP, WP (2x3)\n"
("**Unavailable**", ("- KA2AA-KA9ZZ: US Army in Japan\n" "**Pacific:** KH, WH (2x3)"),
"- KC4AAA-KC4AAF: NSF in Antartica\n" "**Unavailable**": ("- KA2AA-KA9ZZ: US Army in Japan\n"
"- KC4USA-KC4USZ: US Navy in Antartica\n" "- KC4AAA-KC4AAF: NSF in Antartica\n"
"- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n" "- KC4USA-KC4USZ: US Navy in Antartica\n"
"- KL9KAA-KL9KHZ: US military in Korea\n" "- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n"
"- KC6AA-KC6ZZ: Former US (Eastern and Western Caroline Islands), " "- KL9KAA-KL9KHZ: US military in Korea\n"
"now Federated States of Micronesia (V6) and Republic of Palau (T8)\n" "- KC6AA-KC6ZZ: Former US (Eastern and Western Caroline Islands), "
"- KX6AA-KX6ZZ: Former US (Marshall Islands), " "now Federated States of Micronesia (V6) and Republic of Palau (T8)\n"
"now Republic of the Marshall Islands (V73)\n" "- KX6AA-KX6ZZ: Former US (Marshall Islands), "
"- Any suffix SOS or QRA-QUZ\n" "now Republic of the Marshall Islands (V73)\n"
"- Any 2x3 with X as the first suffix letter\n" "- Any suffix SOS or QRA-QUZ\n"
"- Any 2x3 with AF, KF, NF, or WF prefix and suffix EMA: FEMA\n" "- Any 2x3 with X as the first suffix letter\n"
"- Any 2x3 with AA-AL, NA-NZ, WC, WK, WM, WR, or WT prefix: \"Group X\"\n" "- Any 2x3 with AF, KF, NF, or WF prefix and suffix EMA: FEMA\n"
"- Any 2x1, 2x2, or 2x3 with KP, NP, WP prefix and 0, 6, 7, 8, 9 number\n" "- Any 2x3 with AA-AL, NA-NZ, WC, WK, WM, WR, or WT prefix: \"Group X\"\n"
"- Any 1x1 callsign: Special Event"))]) "- 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) # format: country: (title, description, text)
options = {"us": (us_calls_title, us_calls_desc, us_calls)} options = {"us": (us_calls_title, us_calls_desc, us_calls)}