last round of .format conversion for string formatting.

This commit is contained in:
Fletcher Boyd 2013-09-05 10:36:25 +08:00
parent 0aa2185ede
commit 015dd93df3
11 changed files with 45 additions and 45 deletions

View file

@ -9,7 +9,7 @@ api_url = 'http://api.wolframalpha.com/v2/query?format=plaintext'
def time_command(inp, bot=None):
"""time <area> -- Gets the time in <area>"""
query = "current time in %s" % inp
query = "current time in {}".format(inp)
api_key = bot.config.get("api_keys", {}).get("wolframalpha", None)
if not api_key:
@ -27,9 +27,9 @@ def time_command(inp, bot=None):
place = capitalize_first(" ".join(request.xpath("//pod[@"
"title='Input interpretation']/subpod/plaintext/text()"))[
16:])
return "%s - \x02%s\x02" % (time, place)
return "{} - \x02{}\x02".format(time, place)
else:
return "Could not get the time for '%s'." % inp
return "Could not get the time for '{}'.".format(inp)
@hook.command(autohelp=False)