[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / f4 / da2e001fb32ad190850c3b47ad1a6b86119758
1 Return-Path: <patricktotzke@googlemail.com>\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 E1624431FD0\r
6         for <notmuch@notmuchmail.org>; Sat, 28 May 2011 06:18:14 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id S5nShTU1VSo7 for <notmuch@notmuchmail.org>;\r
17         Sat, 28 May 2011 06:18:14 -0700 (PDT)\r
18 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
19         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id D1DB7431FB6\r
22         for <notmuch@notmuchmail.org>; Sat, 28 May 2011 06:18:13 -0700 (PDT)\r
23 Received: by wyi11 with SMTP id 11so2090621wyi.26\r
24         for <notmuch@notmuchmail.org>; Sat, 28 May 2011 06:18:12 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=googlemail.com; s=gamma;\r
27         h=domainkey-signature:subject:from:to:date:message-id:user-agent\r
28         :content-transfer-encoding:mime-version:content-type;\r
29         bh=FR2QpDLDkfj1k2pbyph8uyNtZXaz6Hpe4Uo3yDk0JbM=;\r
30         b=iPGUFN0akGJkvx4Y4moFkpif6R/NM4OHGXicY0jwqK6ZDZA2IvCBEOl8oOW0iQsV2n\r
31         3xD9vSsqc9c38ZLNg0ZLVrh2VLV/iZ+QUKSRfDOgT3S3/tI2W1AjjD8h9xXT2KHL/9ie\r
32         FFMdlqLp1IEWIhuDioEVA+5YCxE5oFINpZM9E=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;\r
34         h=subject:from:to:date:message-id:user-agent\r
35         :content-transfer-encoding:mime-version:content-type;\r
36         b=BukDbMe8L7oZBj9SnkUudObDBlcDPzz0EnaltolUDt96Mde8KbC4PAl4aFTNZnSzQT\r
37         ZazHn+TqSfJys35MeLbZzDYq+CsB6HoHjGya05q9BjSZRYXRjDAD26RbZ9D2aBuSAI75\r
38         p69sGR+PUg7GSibYtJDQG/ZVM/agkVxolqVIU=\r
39 Received: by 10.216.140.147 with SMTP id e19mr3043371wej.49.1306588689390;\r
40         Sat, 28 May 2011 06:18:09 -0700 (PDT)\r
41 Received: from localhost (cpc1-sgyl2-0-0-cust47.sgyl.cable.virginmedia.com\r
42         [80.192.18.48])\r
43         by mx.google.com with ESMTPS id a1sm1499730wek.46.2011.05.28.06.18.07\r
44         (version=TLSv1/SSLv3 cipher=OTHER);\r
45         Sat, 28 May 2011 06:18:08 -0700 (PDT)\r
46 Subject: [python] get all messages of a thread\r
47 From: Patrick Totzke <patricktotzke@googlemail.com>\r
48 To: notmuch <notmuch@notmuchmail.org>\r
49 Date: Sat, 28 May 2011 14:18:05 +0100\r
50 Message-Id: <1306588052-sup-9838@brick>\r
51 User-Agent: Sup/git\r
52 Content-Transfer-Encoding: 8bit\r
53 MIME-Version: 1.0\r
54 Content-Type: multipart/signed; boundary="=-1306588685-701907-25209-4282-1-=";\r
55         protocol="application/pgp-signature"\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Sat, 28 May 2011 13:18:15 -0000\r
69 \r
70 \r
71 --=-1306588685-701907-25209-4282-1-=\r
72 Content-Type: text/plain; charset=UTF-8\r
73 Content-Transfer-Encoding: quoted-printable\r
74 \r
75 Hi!\r
76 I wonder how I would get all messages of a thread with the python\r
77 bindings. The doc says one can only use Thread.get_toplevel_messages()\r
78 and then must recursively call Message.get_replies().\r
79 But look:\r
80 \r
81 ---------------- snip -------------------------\r
82 #/usr/bin/python\r
83 from notmuch import Database\r
84 \r
85 def get_thread():\r
86     query =3D Database().create_query('thread:0000000000000c48')\r
87     return query.search_threads().next()\r
88     =\r
89 \r
90 def replies(msg):\r
91     acc =3D []\r
92     r =3D msg.get_replies()\r
93     if r: #because we cant iterate on NoneType\r
94         for m in r:\r
95             acc.append(m)\r
96             acc +=3D replies(m)\r
97     return acc\r
98     =\r
99 \r
100 t=3Dget_thread()\r
101 \r
102 msgs =3D []\r
103 for m in t.get_toplevel_messages():\r
104     msgs.append(m)\r
105     msgs +=3D replies(m)\r
106 \r
107 print msgs\r
108 ------------------- snap --------------------\r
109 gives:\r
110 \r
111 Traceback (most recent call last):\r
112   File "replies.py", line 22, in <module>\r
113     msgs +=3Dreplies(m)\r
114   File "replies.py", line 12, in replies\r
115     for m in r:\r
116   File "/usr/local/lib/python2.7/dist-packages/notmuch/message.py", line =\r
117 140, in next\r
118     raise NotmuchError(STATUS.NOT_INITIALIZED)\r
119 notmuch.globals.NotmuchError: Operation on uninitialized object impossibl=\r
120 e.\r
121 ---------------------------------------------\r
122 It seems that nobody needed this before. Even in bindings/python/notmuch.=\r
123 py\r
124 only Threads.get_toplevel_messages() gets called, and then a (undocumente=\r
125 d)\r
126 Messages.print_messages is used (cf line 639, in show)\r
127 \r
128 any suggestions?\r
129 I would rather not call the notmuch binary and parse its output..\r
130 Thanks!\r
131 /p\r
132 \r
133 --=-1306588685-701907-25209-4282-1-=\r
134 Content-Disposition: attachment; filename="signature.asc"\r
135 Content-Type: application/pgp-signature; name="signature.asc"\r
136 \r
137 -----BEGIN PGP SIGNATURE-----\r
138 Version: GnuPG v1.4.11 (GNU/Linux)\r
139 \r
140 iEYEARECAAYFAk3g9g0ACgkQlDQDZ9fWxapUPACfSgXkAiqUl6gX/oeqjMe3IxQa\r
141 KXwAnivBb7wQQSPlIhHMyh0b53f8OX5m\r
142 =TGER\r
143 -----END PGP SIGNATURE-----\r
144 \r
145 --=-1306588685-701907-25209-4282-1-=--\r