From 31699c840b5b2b37dbcf4e0c5caa743f4e8de9cf Mon Sep 17 00:00:00 2001 From: neersighted Date: Tue, 28 Feb 2012 22:09:19 -0800 Subject: [PATCH] pep8 --- plugins/metacritic.py | 1 + plugins/validate.py | 1 + plugins/weather.py | 15 +++++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/metacritic.py b/plugins/metacritic.py index aa3d2d6..543d69d 100755 --- a/plugins/metacritic.py +++ b/plugins/metacritic.py @@ -7,6 +7,7 @@ from util import hook, http @hook.command('mc') +@hook.command def metacritic(inp): ".mc [all|movie|tv|album|x360|ps3|pc|ds|wii] -- Gets rating for <title> from metacritic on the specified medium." diff --git a/plugins/validate.py b/plugins/validate.py index 889e154..145c586 100755 --- a/plugins/validate.py +++ b/plugins/validate.py @@ -7,6 +7,7 @@ by Vladi from util import hook, http +@hook.command('w3c') @hook.command def validate(inp): ".validate <url> -- Runs url through the w3c markup validator." diff --git a/plugins/weather.py b/plugins/weather.py index 84f9e55..9f6193d 100755 --- a/plugins/weather.py +++ b/plugins/weather.py @@ -1,10 +1,12 @@ "weather, thanks to google" - from util import hook, http + @hook.command(autohelp=False) -def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None): - ".forecast <location> [dontsave] -- Gets a weather forecast for <location> from Google." +def forecast(inp, nick='', server='', + reply=None, db=None, notice=None, say=None): + ".forecast <location> [dontsave] -- Gets a weather forecast "\ + "for <location> from Google." loc = inp dontsave = loc.endswith(" dontsave") @@ -13,7 +15,7 @@ def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None db.execute("create table if not exists weather(nick primary key, loc)") - if not loc: # blank line + if not loc: loc = db.execute("select loc from weather where nick=lower(?)", (nick,)).fetchone() if not loc: @@ -36,15 +38,16 @@ def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None info = dict((e.tag, e.get('data')) for e in elem) info['high'] = elem.find('high').get('data') info['low'] = elem.find('low').get('data') - out += '[%(day_of_week)s]: %(condition)s (H:%(high)sF'\ ', L:%(low)sF). ' % info return out + @hook.command(autohelp=False) def weather(inp, nick='', server='', reply=None, db=None, notice=None): - ".weather <location> [dontsave] -- Gets weather data for <location> from Google." + ".weather <location> [dontsave] -- Gets weather data"\ + " for <location> from Google." loc = inp dontsave = loc.endswith(" dontsave")