From 289561e76af81d1d55aa5181bccd2703637a5144 Mon Sep 17 00:00:00 2001 From: Dabo Ross Date: Sat, 18 Jan 2014 02:45:34 -0800 Subject: [PATCH] Resolve 'time' name conflicts --- plugins/{time.py => time_plugin.py} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename plugins/{time.py => time_plugin.py} (89%) diff --git a/plugins/time.py b/plugins/time_plugin.py similarity index 89% rename from plugins/time.py rename to plugins/time_plugin.py index b508522..93dd2f2 100644 --- a/plugins/time.py +++ b/plugins/time_plugin.py @@ -16,10 +16,10 @@ def time_command(inp, bot=None): return "error: no wolfram alpha api key set" request = http.get_xml(api_url, input=query, appid=api_key) - time = " ".join(request.xpath("//pod[@title='Result']/subpod/plaintext/text()")) - time = time.replace(" | ", ", ") + current_time = " ".join(request.xpath("//pod[@title='Result']/subpod/plaintext/text()")) + current_time = current_time.replace(" | ", ", ") - if time: + if current_time: # nice place name for UNIX time if inp.lower() == "unix": place = "Unix Epoch" @@ -27,7 +27,7 @@ def time_command(inp, bot=None): place = capitalize_first(" ".join(request.xpath("//pod[@" "title='Input interpretation']/subpod/plaintext/text()"))[ 16:]) - return "{} - \x02{}\x02".format(time, place) + return "{} - \x02{}\x02".format(current_time, place) else: return "Could not get the time for '{}'.".format(inp)