From 0da81ca31e0478a04f6c41dde8eb033cb8fe0abe Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 5 Oct 2012 10:30:03 -0500 Subject: [PATCH] Weather: more verbose zmw codes in ambig. results when printing zmw codes because the query was ambiguous, print city, country rather than just city --- modules/Weather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/Weather.py b/modules/Weather.py index 9049d09..7d68531 100644 --- a/modules/Weather.py +++ b/modules/Weather.py @@ -122,9 +122,11 @@ class Weather(Module): reply = "Multiple results, try one of the following zmw codes:" for res in results[:-1]: q = res['l'].strip('/q/') - reply += " {0:s} ({1:s}),".format(q, res['name']) + reply += " {0:s} ({1:s}, {2:s}),".format(q, res['name'], + res['country_name']) q = results[-1]['l'].strip('/q/') - reply += " or {0:s} ({1:s}).".format(q, results[-1]['name']) + reply += " or {0:s} ({1:s}, {2:s}).".format(q, results[-1]['name'], + results[-1]['country_name']) return reply except KeyError as e: # now we really know something is wrong