diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-06-16 17:33:47 +0200 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-06-16 17:33:47 +0200 |
commit | 12d6f90e77d975be721b6878bf6bbf914d65a369 (patch) | |
tree | df524d29bf82c69c988f1baca37252a171bde2a4 /bindings/python/notmuch/message.py | |
parent | 995303c21bb5012b7eeaa1fe5fd15ae175bfa1e6 (diff) |
Simplify (& fix) Message().__str__()
We were still using len(self.get_replies()) for the __str__ summary of a
mail, but 1) len(Messages()) has just gone away 2) the number of replies
can not be retrieved when we got the message via search_messages()
anyway, and 3) it is likely quite expensive to pull all replies for all
messages that we display a summary of.
So we fix this by simplifying str(Message()) to omit the number of replies.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'bindings/python/notmuch/message.py')
-rw-r--r-- | bindings/python/notmuch/message.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index 706af476..68de5552 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -749,9 +749,7 @@ class Message(object): msg['from'] = self.get_header('from') msg['tags'] = str(self.get_tags()) msg['date'] = date.fromtimestamp(self.get_date()) - replies = self.get_replies() - msg['replies'] = len(replies) if replies is not None else 0 - return "%(from)s (%(date)s) (%(tags)s) %(replies)d replies" % (msg) + return "%(from)s (%(date)s) (%(tags)s)" % (msg) def get_message_parts(self): |