1 Return-Path: <anton@khirnov.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 14DDD429E22
\r
6 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 00:06:40 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id xjFmYMbyO4ve for <notmuch@notmuchmail.org>;
\r
16 Mon, 9 May 2011 00:06:39 -0700 (PDT)
\r
17 Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 4B1AE429E20
\r
22 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 00:06:39 -0700 (PDT)
\r
23 X-Envelope-From: anton@khirnov.net
\r
24 Received: from zohar.localdomain (zohar.kolej.mff.cuni.cz [78.128.198.199])
\r
25 by smtp1.kolej.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id p4976aTV075216
\r
26 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 09:06:37 +0200 (CEST)
\r
27 (envelope-from anton@khirnov.net)
\r
28 Received: by zohar.localdomain (Postfix, from userid 1000)
\r
29 id 699937F508; Mon, 9 May 2011 09:06:36 +0200 (CEST)
\r
30 From: Anton Khirnov <anton@khirnov.net>
\r
31 To: notmuch@notmuchmail.org
\r
32 Subject: [PATCH] python/thread: always return a string in get_subject/authors
\r
33 Date: Mon, 9 May 2011 09:06:34 +0200
\r
34 Message-Id: <1304924794-20380-1-git-send-email-anton@khirnov.net>
\r
35 X-Mailer: git-send-email 1.7.4.4
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.13
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Mon, 09 May 2011 07:06:40 -0000
\r
50 Now None is returned when those don't exist, which is inconvenient to
\r
53 bindings/python/notmuch/thread.py | 6 ++++--
\r
54 1 files changed, 4 insertions(+), 2 deletions(-)
\r
56 diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
\r
57 index eebd6cb..cf26957 100644
\r
58 --- a/bindings/python/notmuch/thread.py
\r
59 +++ b/bindings/python/notmuch/thread.py
\r
60 @@ -281,7 +281,8 @@ class Thread(object):
\r
62 if self._thread is None:
\r
63 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
64 - return Thread._get_authors(self._thread)
\r
65 + ret = Thread._get_authors(self._thread)
\r
66 + return ret if ret else ''
\r
68 def get_subject(self):
\r
69 """Returns the Subject of 'thread'
\r
70 @@ -291,7 +292,8 @@ class Thread(object):
\r
72 if self._thread is None:
\r
73 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
74 - return Thread._get_subject(self._thread)
\r
75 + ret = Thread._get_subject(self._thread)
\r
76 + return ret if ret else ''
\r
78 def get_newest_date(self):
\r
79 """Returns time_t of the newest message date
\r