Seen: punctuation nitpicking, and provide response when user was not seen

This commit is contained in:
Brian S. Stephan 2012-07-10 17:15:52 -05:00
parent d94d7f0c88
commit 395d436008
1 changed files with 3 additions and 1 deletions

View File

@ -110,8 +110,10 @@ class Seen(Module):
db.close()
if result:
seentime = datetime.strptime(result['time'], '%Y-%m-%d %H:%M:%S').replace(tzinfo=tzutc())
replystr = 'last saw {0:s} in {3:s} at {1:s} saying \'{2:s}\''.format(result['nick'], seentime.astimezone(tzlocal()).strftime('%Y/%m/%d %H:%M:%S %Z'), result['what'].encode('utf-8', 'ignore'), result['location'].encode('utf-8', 'ignore'))
replystr = 'last saw {0:s} in {3:s} at {1:s} saying \'{2:s}\'.'.format(result['nick'], seentime.astimezone(tzlocal()).strftime('%Y/%m/%d %H:%M:%S %Z'), result['what'].encode('utf-8', 'ignore'), result['location'].encode('utf-8', 'ignore'))
return self.reply(connection, event, replystr)
else:
return self.reply(connection, event, 'i have not seen {0:s} in {1:s}.'.format(nick, where))
except sqlite3.Error as e:
db.rollback()
db.close()