From 98abab560e1ecafc1c9e36b53a3982e729282704 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Mon, 27 Mar 2023 16:14:11 -0500 Subject: [PATCH] flake8 cleanups --- weather/ircplugin.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/weather/ircplugin.py b/weather/ircplugin.py index 8552618..32061f8 100644 --- a/weather/ircplugin.py +++ b/weather/ircplugin.py @@ -1,20 +1,17 @@ +"""Report on the weather via wttr.in.""" import logging from ircbot.lib import Plugin - from weather.lib import weather_summary - log = logging.getLogger('weather.ircplugin') class Weather(Plugin): - """Have IRC commands to do IRC things (join channels, quit, etc.).""" def start(self): """Set up the handlers.""" - self.connection.reactor.add_global_regex_handler(['pubmsg', 'privmsg'], r'^!weather\s+(.*)$', self.handle_weather, -20) @@ -22,12 +19,12 @@ class Weather(Plugin): def stop(self): """Tear down handlers.""" - self.connection.reactor.remove_global_regex_handler(['pubmsg', 'privmsg'], self.handle_weather) super(Weather, self).stop() def handle_weather(self, connection, event, match): + """Make the weather query and format it for IRC.""" query = match.group(1) queryitems = query.split(" ") if len(queryitems) <= 0: