flake8 cleanups
This commit is contained in:
parent
86e55cb812
commit
98abab560e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user