Merge pull request #158 from classabbyamp/ae7q-bugfixes

Ae7q bugfixes
This commit is contained in:
Abigail Gold 2020-01-04 16:59:48 -05:00 committed by GitHub
commit 07fd9255e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Changelog command to accept a version as argument.
- The qrz command can now link to a QRZ page instead of embedding the data with the `--link` flag.
### Fixed
- Fixed ditto marks (") appearing in the ae7q call command.
- Fixed issue where incorrect table was parsed in ae7q call command.
## [2.1.0] - 2020-01-04

View File

@ -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'):
@ -86,7 +93,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]