[PATCH] python/thread: always return a string in get_subject/authors
authorAnton Khirnov <anton@khirnov.net>
Mon, 9 May 2011 07:06:34 +0000 (09:06 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:11 +0000 (09:38 -0800)
91/1510631a67bea1cd661ffd8de7aa01416b8df1 [new file with mode: 0644]

diff --git a/91/1510631a67bea1cd661ffd8de7aa01416b8df1 b/91/1510631a67bea1cd661ffd8de7aa01416b8df1
new file mode 100644 (file)
index 0000000..ad31cf8
--- /dev/null
@@ -0,0 +1,82 @@
+Return-Path: <anton@khirnov.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 14DDD429E22\r
+       for <notmuch@notmuchmail.org>; Mon,  9 May 2011 00:06:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id xjFmYMbyO4ve for <notmuch@notmuchmail.org>;\r
+       Mon,  9 May 2011 00:06:39 -0700 (PDT)\r
+Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz\r
+       [78.128.192.10])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4B1AE429E20\r
+       for <notmuch@notmuchmail.org>; Mon,  9 May 2011 00:06:39 -0700 (PDT)\r
+X-Envelope-From: anton@khirnov.net\r
+Received: from zohar.localdomain (zohar.kolej.mff.cuni.cz [78.128.198.199])\r
+       by smtp1.kolej.mff.cuni.cz (8.14.4/8.14.4) with ESMTP id p4976aTV075216\r
+       for <notmuch@notmuchmail.org>; Mon, 9 May 2011 09:06:37 +0200 (CEST)\r
+       (envelope-from anton@khirnov.net)\r
+Received: by zohar.localdomain (Postfix, from userid 1000)\r
+       id 699937F508; Mon,  9 May 2011 09:06:36 +0200 (CEST)\r
+From: Anton Khirnov <anton@khirnov.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] python/thread: always return a string in get_subject/authors\r
+Date: Mon,  9 May 2011 09:06:34 +0200\r
+Message-Id: <1304924794-20380-1-git-send-email-anton@khirnov.net>\r
+X-Mailer: git-send-email 1.7.4.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 09 May 2011 07:06:40 -0000\r
+\r
+Now None is returned when those don't exist, which is inconvenient to\r
+deal with.\r
+---\r
+ bindings/python/notmuch/thread.py |    6 ++++--\r
+ 1 files changed, 4 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py\r
+index eebd6cb..cf26957 100644\r
+--- a/bindings/python/notmuch/thread.py\r
++++ b/bindings/python/notmuch/thread.py\r
+@@ -281,7 +281,8 @@ class Thread(object):\r
+         """\r
+         if self._thread is None:\r
+             raise NotmuchError(STATUS.NOT_INITIALIZED)\r
+-        return Thread._get_authors(self._thread)\r
++        ret = Thread._get_authors(self._thread)\r
++        return ret if ret else ''\r
\r
+     def get_subject(self):\r
+         """Returns the Subject of 'thread'\r
+@@ -291,7 +292,8 @@ class Thread(object):\r
+         """\r
+         if self._thread is None:\r
+             raise NotmuchError(STATUS.NOT_INITIALIZED)\r
+-        return Thread._get_subject(self._thread)\r
++        ret = Thread._get_subject(self._thread)\r
++        return ret if ret else ''\r
\r
+     def get_newest_date(self):\r
+         """Returns time_t of the newest message date\r
+-- \r
+1.7.4.4\r
+\r