Merge pull request #128 from avidal/patch-2

Don't include " dontsave" when displaying weather API failures
This commit is contained in:
Ryan Hitchman 2015-01-04 02:31:28 -06:00
commit 7d2932f9c3
1 changed files with 5 additions and 4 deletions

View File

@ -22,11 +22,12 @@ def weather(inp, chan='', nick='', reply=None, db=None, api_key=None):
loc = None loc = None
dontsave = True dontsave = True
else: else:
loc = inp dontsave = inp.endswith(" dontsave")
# strip off the " dontsave" text if it exists and set it back to `inp` so we don't report it
dontsave = loc.endswith(" dontsave") # back to the user incorrectly
if dontsave: if dontsave:
loc = loc[:-9].strip().lower() inp = inp[:-9].strip().lower()
loc = inp
if not loc: # blank line if not loc: # blank line
loc = db.execute( loc = db.execute(