More pythonic function name

This commit is contained in:
Luke Rogers 2013-09-10 14:59:45 +12:00
parent a8255723ba
commit 83cb28283b

View file

@ -3,7 +3,7 @@ import json
from urllib2 import HTTPError from urllib2 import HTTPError
def getSoundInfo(game, search): def get_sound_info(game, search):
search = search.replace(" ", "+") search = search.replace(" ", "+")
try: try:
data = http.get_json("http://p2sounds.blha303.com.au/search/%s/%s" % (game, search)) data = http.get_json("http://p2sounds.blha303.com.au/search/%s/%s" % (game, search))
@ -35,14 +35,14 @@ def getSoundInfo(game, search):
def portal2(inp): def portal2(inp):
"""portal2 <quote> - Look up Portal 2 quote. """portal2 <quote> - Look up Portal 2 quote.
Example: .portal2 demand to see life's manager""" Example: .portal2 demand to see life's manager"""
return getSoundInfo("portal2", inp) return get_sound_info("portal2", inp)
@hook.command @hook.command
def portal2dlc(inp): def portal2dlc(inp):
"""portal2dlc <quote> - Look up Portal 2 DLC quote. """portal2dlc <quote> - Look up Portal 2 DLC quote.
Example: .portal2dlc1 these exhibits are interactive""" Example: .portal2dlc1 these exhibits are interactive"""
return getSoundInfo("portal2dlc1", inp) return get_sound_info("portal2dlc1", inp)
@hook.command("portal2pti") @hook.command("portal2pti")
@ -50,14 +50,14 @@ def portal2dlc(inp):
def portal2dlc2(inp): def portal2dlc2(inp):
"""portal2dlc2 <quote> - Look up Portal 2 Perpetual Testing Inititive quote. """portal2dlc2 <quote> - Look up Portal 2 Perpetual Testing Inititive quote.
Example: .portal2 Cave here.""" Example: .portal2 Cave here."""
return getSoundInfo("portal2dlc2", inp) return get_sound_info("portal2dlc2", inp)
@hook.command @hook.command
def portal2music(inp): def portal2music(inp):
"""portal2music <title> - Look up Portal 2 music. """portal2music <title> - Look up Portal 2 music.
Example: .portal2music turret opera""" Example: .portal2music turret opera"""
return getSoundInfo("portal2music", inp) return get_sound_info("portal2music", inp)
@hook.command('portal1') @hook.command('portal1')
@ -65,7 +65,7 @@ def portal2music(inp):
def portal(inp): def portal(inp):
"""portal <quote> - Look up Portal quote. """portal <quote> - Look up Portal quote.
Example: .portal The last thing you want to do is hurt me""" Example: .portal The last thing you want to do is hurt me"""
return getSoundInfo("portal1", inp) return get_sound_info("portal1", inp)
@hook.command('portal1music') @hook.command('portal1music')
@ -73,7 +73,7 @@ def portal(inp):
def portalmusic(inp): def portalmusic(inp):
"""portalmusic <title> - Look up Portal music. """portalmusic <title> - Look up Portal music.
Example: .portalmusic still alive""" Example: .portalmusic still alive"""
return getSoundInfo("portal1music", inp) return get_sound_info("portal1music", inp)
@hook.command('tf2sound') @hook.command('tf2sound')
@ -81,11 +81,11 @@ def portalmusic(inp):
def tf2(inp): def tf2(inp):
"""tf2 [who - ]<quote> - Look up TF2 quote. """tf2 [who - ]<quote> - Look up TF2 quote.
Example: .tf2 may i borrow your earpiece""" Example: .tf2 may i borrow your earpiece"""
return getSoundInfo("tf2", inp) return get_sound_info("tf2", inp)
@hook.command @hook.command
def tf2music(inp): def tf2music(inp):
"""tf2music title - Look up TF2 music lyrics. """tf2music title - Look up TF2 music lyrics.
Example: .tf2music rocket jump waltz""" Example: .tf2music rocket jump waltz"""
return getSoundInfo("tf2music", inp) return get_sound_info("tf2music", inp)