From 6ef50f5685d447dba4ff75b235b7d953ac32afa3 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Wed, 12 Oct 2016 13:52:07 -0400 Subject: [PATCH] bugfix --- wechat/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wechat/parser.py b/wechat/parser.py index 919d851..2acfb24 100644 --- a/wechat/parser.py +++ b/wechat/parser.py @@ -51,7 +51,7 @@ SELECT username,conRemark,nickname FROM rcontact self.contacts[username] = ensure_unicode(nickname) self.contacts_rev = {v: k for k, v in self.contacts.iteritems()} - logger.info("Found {} contacts.".format(len(self.contacts))) + logger.info("Found {} names in `contact` table.".format(len(self.contacts))) def _parse_msg(self): msgs_tot_cnt = 0 @@ -149,6 +149,6 @@ SELECT {} FROM message values['talker'] = self.contacts[tk_id] except KeyError: # It's possible that messages are kept in database after contacts been deleted - logger.warn("Unknown contact, probably deleted: {}".format(tk_id)) + logger.warn("Unknown contact: {}".format(values.get('talker', '')) return None return values