notmuch webmails
[notmuch-archives.git] / ce / 49741a13be3f522290a8042af30db67bf8efc6
1 Return-Path: <brian@microcomaustralia.com.au>\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 526D4431FD0\r
6         for <notmuch@notmuchmail.org>; Thu,  2 Jun 2011 02:43:34 -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: 2.6\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.6 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         HTML_MESSAGE=0.001, RCVD_ILLEGAL_IP=3.399, RCVD_IN_DNSWL_LOW=-0.7]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id xzsKSHy9pscO for <notmuch@notmuchmail.org>;\r
18         Thu,  2 Jun 2011 02:43:32 -0700 (PDT)\r
19 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
20         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 512D1431FB6\r
23         for <notmuch@notmuchmail.org>; Thu,  2 Jun 2011 02:43:32 -0700 (PDT)\r
24 Received: by bwg12 with SMTP id 12so856872bwg.26\r
25         for <notmuch@notmuchmail.org>; Thu, 02 Jun 2011 02:43:30 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
27         d=microcomaustralia.com.au; s=google;\r
28         h=domainkey-signature:mime-version:x-originating-ip:in-reply-to\r
29         :references:date:message-id:subject:from:to:content-type;\r
30         bh=d2vf8rp+EL55xywuxwT/w285C7B0BUr+prvnnZVQzv8=;\r
31         b=RJ9WN15wnMdNsg8QOOd+T3SqWe/X7+IJ9FuKRWy7ztBZK8lEjACXPTDv+PuqJgBVWI\r
32         t/qc24eNDk2TVsQMhr7BlMcKbnkr5psYNPbApD0lCs6uvNbkZk3PcFtIn8Ga8+bnPqAw\r
33         KN+PSgf6DwcbWTvlwk5P1UkWpiaZfBlurI9gQ=\r
34 DomainKey-Signature: a=rsa-sha1; c=nofws; d=microcomaustralia.com.au;\r
35  s=google;      h=mime-version:x-originating-ip:in-reply-to:references:date\r
36         :message-id:subject:from:to:content-type;\r
37         b=cv9/gREkSfNrQovus52/U3FXZP7elk5VZqN8NMVr7u4vU0L3qzOLdnRZWflRxNapf/\r
38         dBMYYdO1/BrkSu30WROdlKMpiqjyd7+JEpwE/j+8/nSQGYWE4HbGWP468+UJ5+4OB5E/\r
39         LSBSpJq+538efk7bcD1HOgMDZM8r4frNruUPE=\r
40 MIME-Version: 1.0\r
41 Received: by 10.204.143.4 with SMTP id s4mr494087bku.98.1307007809620; Thu, 02\r
42         Jun 2011 02:43:29 -0700 (PDT)\r
43 Received: by 10.204.82.147 with HTTP; Thu, 2 Jun 2011 02:43:29 -0700 (PDT)\r
44 X-Originating-IP: [253.99.196.189]\r
45 In-Reply-To: <87aae07lxi.fsf@SSpaeth.de>\r
46 References: <1306588052-sup-9838@brick>\r
47         <BANLkTikEJ9dJ5kLg2QJQ+egHg2sh7S1wiA@mail.gmail.com>\r
48         <87aae07lxi.fsf@SSpaeth.de>\r
49 Date: Thu, 2 Jun 2011 19:43:29 +1000\r
50 Message-ID: <BANLkTi=df3+LBWasFic9ZNrKaLGA7Bmdew@mail.gmail.com>\r
51 Subject: Re: [python] get all messages of a thread\r
52 From: Brian May <brian@microcomaustralia.com.au>\r
53 To: notmuch <notmuch@notmuchmail.org>\r
54 Content-Type: multipart/alternative; boundary=0015173fe9ba360c6d04a4b77874\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Thu, 02 Jun 2011 09:43:34 -0000\r
68 \r
69 --0015173fe9ba360c6d04a4b77874\r
70 Content-Type: text/plain; charset=windows-1252\r
71 Content-Transfer-Encoding: quoted-printable\r
72 \r
73 On 2 June 2011 17:05, Sebastian Spaeth <Sebastian@sspaeth.de> wrote:\r
74 \r
75 > What would be the best way to solve this (besides fixing the C api to\r
76 > allow to reset the iterator ;-) ?)\r
77 >\r
78 >\r
79  I am not really familiar with the code. So am I correct in making the\r
80 following assumptions?\r
81 \r
82 * It is not easy to fix the C api to reset the iterator (what about\r
83 repeating the search?)\r
84 \r
85 * The only accurate way to get the number of messages is to iterate through\r
86 every search result and count them?\r
87 \r
88 If so, then len(...) I think might be very slow if there are a large number\r
89 of elements.\r
90 \r
91 Maybe it might be easier/better to implement object.__nonzero__(self)\r
92  instead of the object.__len__(self) method?\r
93 \r
94 http://docs.python.org/reference/datamodel.html\r
95 \r
96 object.__nonzero__(self)\r
97 Called to implement truth value testing and the built-in operation bool();\r
98 should return False or True, or their integer equivalents 0 or 1. When this\r
99 method is not defined, __len__() is called, if it is defined, and the objec=\r
100 t\r
101 is considered true if its result is nonzero. If a class defines neither\r
102 __len__() nor __nonzero__(), all its instances are considered true.\r
103 \r
104 object.__len__(self)\r
105 Called to implement the built-in function len(). Should return the length o=\r
106 f\r
107 the object, an integer >=3D 0. Also, an object that doesn=92t define a\r
108 __nonzero__() method and whose __len__() method returns zero is considered\r
109 to be false in a Boolean context.\r
110 \r
111 --=20\r
112 Brian May <brian@microcomaustralia.com.au>\r
113 \r
114 --0015173fe9ba360c6d04a4b77874\r
115 Content-Type: text/html; charset=windows-1252\r
116 Content-Transfer-Encoding: quoted-printable\r
117 \r
118 <div class=3D"gmail_quote">On 2 June 2011 17:05, Sebastian Spaeth <span dir=\r
119 =3D"ltr">&lt;<a href=3D"mailto:Sebastian@sspaeth.de">Sebastian@sspaeth.de</=\r
120 a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=\r
121  0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">\r
122 <div class=3D"im">What would be the best way to solve this (besides fixing =\r
123 the C api to</div>\r
124 allow to reset the iterator ;-) ?)<br><br></blockquote><div><br></div><div>=\r
125 =A0I am not really familiar with the code. So am I correct in making the fo=\r
126 llowing assumptions?</div><div><br></div><div>* It is not easy to fix the C=\r
127  api to reset the iterator (what about repeating the search?)</div>\r
128 <div><br></div><div>* The only accurate way to get the number of messages i=\r
129 s to iterate through every search result and count them?</div><div><br></di=\r
130 v><div>If so, then len(...) I think might be very slow if there are a large=\r
131  number of elements.</div>\r
132 <div><br></div><div>Maybe it might be easier/better to implement=A0object._=\r
133 _nonzero__(self) =A0instead of the object.__len__(self) method?</div><div><=\r
134 br></div><div><a href=3D"http://docs.python.org/reference/datamodel.html">h=\r
135 ttp://docs.python.org/reference/datamodel.html</a></div>\r
136 <div><br></div><div><div>object.__nonzero__(self)</div><div>Called to imple=\r
137 ment truth value testing and the built-in operation bool(); should return F=\r
138 alse or True, or their integer equivalents 0 or 1. When this method is not =\r
139 defined, __len__() is called, if it is defined, and the object is considere=\r
140 d true if its result is nonzero. If a class defines neither __len__() nor _=\r
141 _nonzero__(), all its instances are considered true.</div>\r
142 <div><br></div><div><div>object.__len__(self)</div><div>Called to implement=\r
143  the built-in function len(). Should return the length of the object, an in=\r
144 teger &gt;=3D 0. Also, an object that doesn=92t define a __nonzero__() meth=\r
145 od and whose __len__() method returns zero is considered to be false in a B=\r
146 oolean context.</div>\r
147 </div></div><div><br></div></div>-- <br>Brian May &lt;<a href=3D"mailto:bri=\r
148 an@microcomaustralia.com.au">brian@microcomaustralia.com.au</a>&gt;<br>\r
149 \r
150 --0015173fe9ba360c6d04a4b77874--\r