pep8
This commit is contained in:
parent
79b4f15b45
commit
31699c840b
3 changed files with 11 additions and 6 deletions
|
@ -7,6 +7,7 @@ from util import hook, http
|
||||||
|
|
||||||
|
|
||||||
@hook.command('mc')
|
@hook.command('mc')
|
||||||
|
@hook.command
|
||||||
def metacritic(inp):
|
def metacritic(inp):
|
||||||
".mc [all|movie|tv|album|x360|ps3|pc|ds|wii] <title> -- Gets rating for <title> from metacritic on the specified medium."
|
".mc [all|movie|tv|album|x360|ps3|pc|ds|wii] <title> -- Gets rating for <title> from metacritic on the specified medium."
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ by Vladi
|
||||||
from util import hook, http
|
from util import hook, http
|
||||||
|
|
||||||
|
|
||||||
|
@hook.command('w3c')
|
||||||
@hook.command
|
@hook.command
|
||||||
def validate(inp):
|
def validate(inp):
|
||||||
".validate <url> -- Runs url through the w3c markup validator."
|
".validate <url> -- Runs url through the w3c markup validator."
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
"weather, thanks to google"
|
"weather, thanks to google"
|
||||||
|
|
||||||
from util import hook, http
|
from util import hook, http
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def forecast(inp, nick='', server='', reply=None, db=None, notice=None, say=None):
|
def forecast(inp, nick='', server='',
|
||||||
".forecast <location> [dontsave] -- Gets a weather forecast for <location> from Google."
|
reply=None, db=None, notice=None, say=None):
|
||||||
|
".forecast <location> [dontsave] -- Gets a weather forecast "\
|
||||||
|
"for <location> from Google."
|
||||||
loc = inp
|
loc = inp
|
||||||
|
|
||||||
dontsave = loc.endswith(" dontsave")
|
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)")
|
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(?)",
|
loc = db.execute("select loc from weather where nick=lower(?)",
|
||||||
(nick,)).fetchone()
|
(nick,)).fetchone()
|
||||||
if not loc:
|
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 = dict((e.tag, e.get('data')) for e in elem)
|
||||||
info['high'] = elem.find('high').get('data')
|
info['high'] = elem.find('high').get('data')
|
||||||
info['low'] = elem.find('low').get('data')
|
info['low'] = elem.find('low').get('data')
|
||||||
|
|
||||||
out += '[%(day_of_week)s]: %(condition)s (H:%(high)sF'\
|
out += '[%(day_of_week)s]: %(condition)s (H:%(high)sF'\
|
||||||
', L:%(low)sF). ' % info
|
', L:%(low)sF). ' % info
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def weather(inp, nick='', server='', reply=None, db=None, notice=None):
|
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
|
loc = inp
|
||||||
|
|
||||||
dontsave = loc.endswith(" dontsave")
|
dontsave = loc.endswith(" dontsave")
|
||||||
|
|
Reference in a new issue