Re: [python] get all messages of a thread
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Thu, 2 Jun 2011 07:05:29 +0000 (09:05 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:29 +0000 (09:38 -0800)
5f/3e69e7a13144539f569e5de7023f8bf608fc60 [new file with mode: 0644]

diff --git a/5f/3e69e7a13144539f569e5de7023f8bf608fc60 b/5f/3e69e7a13144539f569e5de7023f8bf608fc60
new file mode 100644 (file)
index 0000000..1d5381f
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <Sebastian@SSpaeth.de>\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 53CAB431FD0\r
+       for <notmuch@notmuchmail.org>; Thu,  2 Jun 2011 00:05:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.09\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] 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 fBd-KXKp0B3v for <notmuch@notmuchmail.org>;\r
+       Thu,  2 Jun 2011 00:05:48 -0700 (PDT)\r
+Received: from homiemail-a19.g.dreamhost.com (caiajhbdccah.dreamhost.com\r
+       [208.97.132.207])\r
+       by olra.theworths.org (Postfix) with ESMTP id B55CF431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  2 Jun 2011 00:05:48 -0700 (PDT)\r
+Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1])\r
+       by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id D817F604084;\r
+       Thu,  2 Jun 2011 00:05:47 -0700 (PDT)\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:cc:subject\r
+       :in-reply-to:references:date:message-id:mime-version:\r
+       content-type; q=dns; s=sspaeth.de; b=flVEbuy11SPZs76/MlgZ/brIf4e\r
+       UjI6F3fj24hbnVp9YlrJr/Qs0iPkeRpnGndDQckR9TFBW2r7Z7WvKze1CE7cBHdv\r
+       I6jcYboBTC7fEhcnN3Ss6R5li73vlnKG0EiN6v0F5WEVuA7G5J2Yt+dAA6tCK3OA\r
+       /xy/8FuL1YGEz0jA=\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to:cc\r
+       :subject:in-reply-to:references:date:message-id:mime-version:\r
+       content-type; s=sspaeth.de; bh=LcWpqYo8zAqiH9WOcrczEC23w/Q=; b=g\r
+       0iQ47vmE3WlvTBsw7yUvv24OUlXgGfR9c07i+7Q2sNhiK9t2D1xEitRrlglWXTaV\r
+       zPlTFn3vkYZcQSYYjw8RZT9v79SpTIFW3yerNRtZuZh+3wHiEMiJeGIR0J6lJJmt\r
+       qf0kN20QErTsM/w8nqRdn1cycs00C3aaTrXir+Vbx8=\r
+Received: from spaetzbook.sspaeth.de (unknown [195.250.171.64])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       (Authenticated sender: fax@sspaeth.de)\r
+       by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPSA id 56CBC604079; \r
+       Thu,  2 Jun 2011 00:05:40 -0700 (PDT)\r
+Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation);\r
+       Thu, 02 Jun 2011 09:05:29 +0200\r
+From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
+To: Brian May <brian@microcomaustralia.com.au>,\r
+       Patrick Totzke <patricktotzke@googlemail.com>\r
+Subject: Re: [python] get all messages of a thread\r
+In-Reply-To: <BANLkTikEJ9dJ5kLg2QJQ+egHg2sh7S1wiA@mail.gmail.com>\r
+References: <1306588052-sup-9838@brick>\r
+       <BANLkTikEJ9dJ5kLg2QJQ+egHg2sh7S1wiA@mail.gmail.com>\r
+User-Agent: Notmuch/0.5-209-gc8b5718 (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 02 Jun 2011 09:05:29 +0200\r
+Message-ID: <87aae07lxi.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Cc: notmuch <notmuch@notmuchmail.org>\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: Thu, 02 Jun 2011 07:05:49 -0000\r
+\r
+--=-=-=\r
+\r
+On Wed, 1 Jun 2011 15:35:35 +1000, Brian May wrote:\r
+> Oh, I see, for your code, there is a implied call to __len__, and the\r
+> __len__ function is completely broken for the reasons described in the\r
+> documentation:\r
+\r
+It seems to have been a bad idea to implement __len__ at all for the\r
+Messsages() construct in the python bindings, and I wonder if I should\r
+remove it.\r
+\r
+On the other hand, it seems that list(Messages()) implicitely calls\r
+len(), or so it seems from the error that we get when trying to list() a\r
+messages object.\r
+\r
+An alternative is to implement len() as a call to count_messages() which\r
+has for me so far always returned the correct number of messages without\r
+using up the iterator. However, the xapian docs explicitely state that\r
+it does not guarantee that the count will be correct, so len() might\r
+return a wrong message size (potentially).\r
+\r
+What would be the best way to solve this (besides fixing the C api to\r
+allow to reset the iterator ;-) ?)\r
+\r
+I could implement a custom .as_list() function that returns the\r
+Messages() object as a list that is guaranteed to be stable, by copying\r
+out the Message() objects into a list.\r
+\r
+Sebastian\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk3nNjkACgkQVYX1jMgnoGJwrwCfTDJ4FxGbMYRyI8rcWrHvOHTz\r
+lDsAnR1MA0rfwKMBBJzAVLJ73jZpbInt\r
+=98j3\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r