mirror of
				https://github.com/miaowware/qrm2.git
				synced 2025-10-31 03:10:21 -04:00 
			
		
		
		
	convert all OrderedDicts to dictionaries (#214)
Fixes #184 Co-authored-by: 0x5c <dev@0x5c.io>
This commit is contained in:
		
							parent
							
								
									6867c45c8c
								
							
						
					
					
						commit
						bc93462c29
					
				| @ -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 | ||||||
|  | |||||||
| @ -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 = "" | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										40
									
								
								exts/qrz.py
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								exts/qrz.py
									
									
									
									
									
								
							| @ -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): | ||||||
|  | |||||||
| @ -8,35 +8,33 @@ 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 = { | ||||||
|  |                 "**Group A** (Extra Only)": ("**Any:** K, N, W (1x2)\n" | ||||||
|                                              "    AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n" |                                              "    AA-AL, KA-KZ, NA-NZ, WA-WZ (2x1)\n" | ||||||
|                                              "    AA-AL (2x2)\n" |                                              "    AA-AL (2x2)\n" | ||||||
|                                              "*Except*\n" |                                              "*Except*\n" | ||||||
|                                              "**Alaska:** AL, KL, NL, WL (2x1)\n" |                                              "**Alaska:** AL, KL, NL, WL (2x1)\n" | ||||||
|                                              "**Caribbean:** KP, NP, WP (2x1)\n" |                                              "**Caribbean:** KP, NP, WP (2x1)\n" | ||||||
|                                                       "**Pacific:** AH, KH, NH, WH (2x1)")), |                                              "**Pacific:** AH, KH, NH, WH (2x1)"), | ||||||
|                         ("**Group B** (Advanced and Extra Only)", ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n" |                 "**Group B** (Advanced and Extra Only)": ("**Any:** KA-KZ, NA-NZ, WA-WZ (2x2)\n" | ||||||
|                                                           "*Except*\n" |                                                           "*Except*\n" | ||||||
|                                                           "**Alaska:** AL (2x2)\n" |                                                           "**Alaska:** AL (2x2)\n" | ||||||
|                                                           "**Caribbean:** KP (2x2)\n" |                                                           "**Caribbean:** KP (2x2)\n" | ||||||
|                                                                    "**Pacific:** AH (2x2)")), |                                                           "**Pacific:** AH (2x2)"), | ||||||
|                         ("**Group C** (Technician, General, Advanced, Extra Only)", ("**Any Region:** K, N, W (1x3)\n" |                 "**Group C** (Technician, General, Advanced, Extra Only)": ("**Any Region:** K, N, W (1x3)\n" | ||||||
|                                                                             "*Except*\n" |                                                                             "*Except*\n" | ||||||
|                                                                             "**Alaska:** KL, NL, WL (2x2)\n" |                                                                             "**Alaska:** KL, NL, WL (2x2)\n" | ||||||
|                                                                             "**Caribbean:** NP, WP (2x2)\n" |                                                                             "**Caribbean:** NP, WP (2x2)\n" | ||||||
|                                                                                      "**Pacific:** KH, NH, WH (2x2)")), |                                                                             "**Pacific:** KH, NH, WH (2x2)"), | ||||||
|                         ("**Group D** (Any License Class)", ("**Any Region:** KA-KZ, WA-WZ (2x3)\n" |                 "**Group D** (Any License Class)": ("**Any Region:** KA-KZ, WA-WZ (2x3)\n" | ||||||
|                                                     "*Except*\n" |                                                     "*Except*\n" | ||||||
|                                                     "**Alaska:** KL, WL (2x3)\n" |                                                     "**Alaska:** KL, WL (2x3)\n" | ||||||
|                                                     "**Caribbean:** KP, WP (2x3)\n" |                                                     "**Caribbean:** KP, WP (2x3)\n" | ||||||
|                                                              "**Pacific:** KH, WH (2x3)")), |                                                     "**Pacific:** KH, WH (2x3)"), | ||||||
|                         ("**Unavailable**", ("- KA2AA-KA9ZZ: US Army in Japan\n" |                 "**Unavailable**": ("- KA2AA-KA9ZZ: US Army in Japan\n" | ||||||
|                                     "- KC4AAA-KC4AAF: NSF in Antartica\n" |                                     "- KC4AAA-KC4AAF: NSF in Antartica\n" | ||||||
|                                     "- KC4USA-KC4USZ: US Navy in Antartica\n" |                                     "- KC4USA-KC4USZ: US Navy in Antartica\n" | ||||||
|                                     "- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n" |                                     "- KG4AA-KG4ZZ: US Navy in Guantanamo Bay\n" | ||||||
| @ -50,7 +48,8 @@ us_calls = OrderedDict([("**Group A** (Extra Only)", ("**Any:** K, N, W (1x2)\n" | |||||||
|                                     "- Any 2x3 with AF, KF, NF, or WF prefix and suffix EMA: FEMA\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 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 2x1, 2x2, or 2x3 with KP, NP, WP prefix and 0, 6, 7, 8, 9 number\n" | ||||||
|                                              "- Any 1x1 callsign: Special Event"))]) |                                     "- 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)} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user