From 9552a7f6d4dc2a0fd3ff57fc378e7531d0912b83 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Sat, 4 Jan 2020 15:40:40 -0500 Subject: [PATCH 1/2] Fixed ditto marks appearing in ae7q call Fixes #151 --- CHANGELOG.md | 2 ++ exts/ae7q.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b38bda7..b355beb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Fixed ditto marks (") appearing in the ae7q call command. ## [v2.1.0] - 2020-01-04 diff --git a/exts/ae7q.py b/exts/ae7q.py index 43a6981..03b7d42 100644 --- a/exts/ae7q.py +++ b/exts/ae7q.py @@ -86,7 +86,7 @@ class AE7QCog(commands.Cog): row_cells.append(row_cells[-1]) for i, cell in enumerate(row_cells): if cell == '"': - cell = table_contents[-1][i] + row_cells[i] = table_contents[-1][i] if len(row_cells) > 1: table_contents += [row_cells] From 60f8e80b8223fbb4c7b204487dbfc056b4910a37 Mon Sep 17 00:00:00 2001 From: Abigail Gold Date: Sat, 4 Jan 2020 16:33:49 -0500 Subject: [PATCH 2/2] Fixed issue where incorrect table was parsed in ae7q call Fixes #152 --- CHANGELOG.md | 1 + exts/ae7q.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b355beb..3fed3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Fixed - Fixed ditto marks (") appearing in the ae7q call command. +- Fixed issue where incorrect table was parsed in ae7q call command. ## [v2.1.0] - 2020-01-04 diff --git a/exts/ae7q.py b/exts/ae7q.py index 03b7d42..6671c7c 100644 --- a/exts/ae7q.py +++ b/exts/ae7q.py @@ -11,6 +11,8 @@ KN8U: active, restricted AB2EE: expired, restricted KE8FGB: assigned once, no restrictions NA2AAA: unassigned, no records +KC4USA: reserved but has call history +WF4EMA: " """ import discord.ext.commands as commands @@ -62,7 +64,9 @@ class AE7QCog(commands.Cog): desc = desc.replace(callsign, f'`{callsign}`') rows = None - if rows is None: + first_header = ''.join(rows[0].find_all("th")[0].strings) + + if rows is None or first_header != 'Entity Name': embed.title = f"AE7Q History for {callsign}" embed.colour = cmn.colours.bad embed.url = f"{base_url}{callsign}" @@ -74,6 +78,9 @@ class AE7QCog(commands.Cog): table_contents = [] # store your table here for tr in rows: if rows.index(tr) == 0: + # first_header = ''.join(tr.find_all("th")[0].strings) + # if first_header == 'Entity Name': + # print('yooooo') continue row_cells = [] for td in tr.find_all('td'):