From fcbb3be028f785ca2076d46f163ffb3ee7843042 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 15 Dec 2019 19:09:29 -0500 Subject: [PATCH 1/5] update changelog and bump version --- CHANGELOG.md | 24 +++++++++++++++--------- info.py | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a60a9..070209b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,23 +3,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [v2.0.0] - 2019-12-15 ### Added - Global info, secrets, and options are now stored in their own files, using [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) -- Rich lookup for AE7Q (callsigns only, more to come) -- Rich lookup for QRZ, if a QRZ subscription is present +- Common functions, checks, and data are now stored in their own file +- Rich lookup for AE7Q.com (callsigns only, more to come) +- Rich lookup for QRZ.com, if a QRZ subscription is present - Timestamp and requester username and avatar are now shown on embeds -- Current and 3-Day Forecast terrestrial weather conditions lookup commands -- Extension control commands. +- Current and 3-Day forecast for terrestrial weather conditions lookup commands +- Extension control commands - Changelog command +- Command to show callsign rules +- Docker support, including an [official docker image](https://hub.docker.com/r/classabbyamp/discord-qrm2) and instructions for running the bot in docker ### Changed -- Rewrote code to take advantage of discord.py's cogs -- Moved most bot responses into embeds +- Rewrote code to take advantage of discord.py's cogs and extensions +- Moved most bot responses into embed - Re-implemented shutdown and restart commands using discord.py checks - Embed colors now fit with discord's theme -- The contest calendar command no longer relies on `selenium` +- The contest calendar command no longer relies on `selenium` (more improvements to come) +- Improved the help command, taking advantage of discord.py's new features +- Improved command and argument names to be more clear ### Removed -- CTY.DAT parsing is now its own library (`ctyparser` available on pypi) +- CTY.DAT parsing is now its own library ([`ctyparser` available on pypi](https://pypi.org/project/ctyparser/)) - Removed Herobrine ### Fixed - Cleaned up code to comply with the PEP8 Standard +- Issue in morse and unmorse commands where spaces were not interpreted correctly diff --git a/info.py b/info.py index 20a174d..4a51919 100644 --- a/info.py +++ b/info.py @@ -24,4 +24,4 @@ authors = ("@ClassAbbyAmplifier#2229", "@0x5c#0639") description = """A bot with various useful ham radio-related functions, written in Python.""" license = "Released under the GNU General Public License v2" contributing = "Check out the source on GitHub, contributions welcome: https://github.com/classabbyamp/discord-qrm2" -release = '1.0.0' +release = '2.0.0' From d522389f9f9bc84f9e72726efc4dd1490c12b0b0 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 15 Dec 2019 19:10:03 -0500 Subject: [PATCH 2/5] change changelog command to only display the most recent version --- exts/base.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exts/base.py b/exts/base.py index 4adb6cb..a237234 100644 --- a/exts/base.py +++ b/exts/base.py @@ -139,7 +139,7 @@ class BaseCog(commands.Cog): @commands.command(name="changelog", aliases=["clog"]) async def _changelog(self, ctx: commands.Context): - """Show what has changed in recent bot versions.""" + """Show what has changed in the most recent bot version.""" embed = discord.Embed(title="qrm Changelog", description=("For a full listing, visit [Github](https://" "github.com/classabbyamp/discord-qrm2/blob/master/CHANGELOG.md)."), @@ -153,12 +153,12 @@ class BaseCog(commands.Cog): for ver, log in changelog.items(): if ver.lower() != 'unreleased': if 'date' in log: - header = f'**{ver}** ({log["date"]})' + embed.description += f'\n\n**{ver}** ({log["date"]})' else: - header = f'**{ver}**' - embed.add_field(name=header, value=await format_changelog(log), inline=False) + embed.description += f'\n\n**{ver}**' + embed = await format_changelog(log, embed) vers += 1 - if vers >= 2: + if vers >= 1: break await ctx.send(embed=embed) @@ -187,14 +187,14 @@ def parse_changelog(): return changelog -async def format_changelog(log: dict): - formatted = '' +async def format_changelog(log: dict, embed: discord.Embed): for header, lines in log.items(): + formatted = '' if header != 'date': - formatted += f'**{header}**\n' for line in lines: formatted += f'- {line}\n' - return formatted + embed.add_field(name=f'**{header}**', value=formatted, inline=False) + return embed def setup(bot: commands.Bot): From 9aa720b4e9edba290ba05dd552566e6ac7a84a8e Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 15 Dec 2019 23:47:22 -0500 Subject: [PATCH 3/5] updates to changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 070209b..010e05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [v2.0.0] - 2019-12-15 +## [Unreleased](https://github.com/classabbyamp/discord-qrm2/compare/v2.0.0...HEAD) +## [v2.0.0](https://github.com/classabbyamp/discord-qrm2/releases/tag/v2.0.0) - 2019-12-16 ### Added -- Global info, secrets, and options are now stored in their own files, using [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) -- Common functions, checks, and data are now stored in their own file +- Global info, secrets, and options are now stored in their own files, based on [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) - Rich lookup for AE7Q.com (callsigns only, more to come) - Rich lookup for QRZ.com, if a QRZ subscription is present - Timestamp and requester username and avatar are now shown on embeds From afa2054323e6ce47483ab870bc0af7ac0bb3e5c7 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 16 Dec 2019 00:02:21 -0500 Subject: [PATCH 4/5] reorder changelog, add links, fix changelog parser --- CHANGELOG.md | 24 ++++++++++++++---------- exts/base.py | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 010e05b..d4a4995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,29 +3,33 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased](https://github.com/classabbyamp/discord-qrm2/compare/v2.0.0...HEAD) -## [v2.0.0](https://github.com/classabbyamp/discord-qrm2/releases/tag/v2.0.0) - 2019-12-16 +## [Unreleased] + +## [v2.0.0] - 2019-12-16 ### Added -- Global info, secrets, and options are now stored in their own files, based on [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) - Rich lookup for AE7Q.com (callsigns only, more to come) - Rich lookup for QRZ.com, if a QRZ subscription is present -- Timestamp and requester username and avatar are now shown on embeds - Current and 3-Day forecast for terrestrial weather conditions lookup commands -- Extension control commands - Changelog command - Command to show callsign rules +- Extension control commands +- Timestamp and requester username and avatar are now shown on embeds - Docker support, including an [official docker image](https://hub.docker.com/r/classabbyamp/discord-qrm2) and instructions for running the bot in docker +- Global info, secrets, and options are now stored in their own files, based on [0x5c/quick-bot-no-pain](https://github.com/0x5c/quick-bot-no-pain) ### Changed -- Rewrote code to take advantage of discord.py's cogs and extensions -- Moved most bot responses into embed -- Re-implemented shutdown and restart commands using discord.py checks -- Embed colors now fit with discord's theme -- The contest calendar command no longer relies on `selenium` (more improvements to come) - Improved the help command, taking advantage of discord.py's new features - Improved command and argument names to be more clear +- Embed colors now fit with discord's theme +- Re-implemented shutdown and restart commands using discord.py checks +- The contest calendar command no longer relies on `selenium` (more improvements to come) +- Rewrote code to take advantage of discord.py's cogs and extensions +- Moved most bot responses into embeds ### Removed - CTY.DAT parsing is now its own library ([`ctyparser` available on pypi](https://pypi.org/project/ctyparser/)) - Removed Herobrine ### Fixed - Cleaned up code to comply with the PEP8 Standard - Issue in morse and unmorse commands where spaces were not interpreted correctly + +[Unreleased]: https://github.com/classabbyamp/discord-qrm2/compare/v2.0.0...HEAD +[v2.0.0]: https://github.com/classabbyamp/discord-qrm2/releases/tag/v2.0.0 diff --git a/exts/base.py b/exts/base.py index a237234..0542d37 100644 --- a/exts/base.py +++ b/exts/base.py @@ -183,7 +183,8 @@ def parse_changelog(): heading = line.lstrip('#').strip() changelog[ver][heading] = [] elif ver != '' and heading != '': - changelog[ver][heading].append(line.lstrip('-').strip()) + if line.startswith('-'): + changelog[ver][heading].append(line.lstrip('-').strip()) return changelog From 7416596ac363c143556068356411177449903af3 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 16 Dec 2019 00:15:37 -0500 Subject: [PATCH 5/5] add yanked v1.0.0, update parser to handle yanked versions --- CHANGELOG.md | 2 ++ exts/base.py | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4a4995..43df85b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,5 +31,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Cleaned up code to comply with the PEP8 Standard - Issue in morse and unmorse commands where spaces were not interpreted correctly +## v1.0.0 - 2019-07-31 [YANKED] + [Unreleased]: https://github.com/classabbyamp/discord-qrm2/compare/v2.0.0...HEAD [v2.0.0]: https://github.com/classabbyamp/discord-qrm2/releases/tag/v2.0.0 diff --git a/exts/base.py b/exts/base.py index 0542d37..4dd27e4 100644 --- a/exts/base.py +++ b/exts/base.py @@ -175,10 +175,11 @@ def parse_changelog(): continue if re.match(r'##[^#]', line): ver_match = re.match(r'\[(.+)\](?: - )?(\d{4}-\d{2}-\d{2})?', line.lstrip('#').strip()) - ver = ver_match.group(1) - changelog[ver] = dict() - if ver_match.group(2): - changelog[ver]['date'] = ver_match.group(2) + if ver_match is not None: + ver = ver_match.group(1) + changelog[ver] = dict() + if ver_match.group(2): + changelog[ver]['date'] = ver_match.group(2) elif re.match(r'###[^#]', line): heading = line.lstrip('#').strip() changelog[ver][heading] = []