1 Return-Path: <teythoon@jade-hamburg.de>
\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 E2409429E35
\r
6 for <notmuch@notmuchmail.org>; Wed, 14 Dec 2011 02:59:01 -0800 (PST)
\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 ydT3UuHwodFZ for <notmuch@notmuchmail.org>;
\r
16 Wed, 14 Dec 2011 02:59:01 -0800 (PST)
\r
17 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])
\r
18 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id BDD52429E34
\r
21 for <notmuch@notmuchmail.org>; Wed, 14 Dec 2011 02:59:00 -0800 (PST)
\r
22 Received: from mail.jade-hamburg.de (unknown [85.183.11.228])
\r
23 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
\r
24 (No client certificate requested)
\r
25 by mail.cryptobitch.de (Postfix) with ESMTPSA id 6C45E50F614
\r
26 for <notmuch@notmuchmail.org>; Wed, 14 Dec 2011 11:58:59 +0100 (CET)
\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)
\r
28 id E3596DF2A0; Wed, 14 Dec 2011 11:58:58 +0100 (CET)
\r
29 Received: from thinkbox.jade-hamburg.de (unknown [85.183.11.228])
\r
30 (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
31 (No client certificate requested) (Authenticated sender: teythoon)
\r
32 by mail.jade-hamburg.de (Postfix) with ESMTPSA id E4A6ADF2A3;
\r
33 Wed, 14 Dec 2011 11:58:47 +0100 (CET)
\r
34 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77)
\r
35 (envelope-from <teythoon@thinkbox.jade-hamburg.de>)
\r
36 id 1RamXr-0004Mb-PL; Wed, 14 Dec 2011 11:58:43 +0100
\r
37 From: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH 4/7] py3k: Rename .next() to __next__(),
\r
40 add python2.x compatibility alias
\r
41 Date: Wed, 14 Dec 2011 11:58:22 +0100
\r
43 <1323860305-15802-5-git-send-email-4winter@informatik.uni-hamburg.de>
\r
44 X-Mailer: git-send-email 1.7.7.3
\r
46 <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
48 <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Wed, 14 Dec 2011 10:59:02 -0000
\r
64 bindings/python/notmuch/database.py | 3 ++-
\r
65 bindings/python/notmuch/message.py | 3 ++-
\r
66 bindings/python/notmuch/tag.py | 3 ++-
\r
67 bindings/python/notmuch/thread.py | 3 ++-
\r
68 4 files changed, 8 insertions(+), 4 deletions(-)
\r
70 diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
\r
71 index 9318368..3f6e04d 100644
\r
72 --- a/bindings/python/notmuch/database.py
\r
73 +++ b/bindings/python/notmuch/database.py
\r
74 @@ -925,7 +925,7 @@ class Filenames(object):
\r
75 _move_to_next.argtypes = [NotmuchFilenamesP]
\r
76 _move_to_next.restype = None
\r
79 + def __next__(self):
\r
80 if self._files_p is None:
\r
81 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
83 @@ -936,6 +936,7 @@ class Filenames(object):
\r
84 file = Filenames._get(self._files_p)
\r
85 self._move_to_next(self._files_p)
\r
87 + next = __next__ # python2.x iterator protocol compatibility
\r
90 """len(:class:`Filenames`) returns the number of contained files
\r
91 diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
\r
92 index ce8e718..bf0c4da 100644
\r
93 --- a/bindings/python/notmuch/message.py
\r
94 +++ b/bindings/python/notmuch/message.py
\r
95 @@ -158,7 +158,7 @@ class Messages(object):
\r
96 _move_to_next.argtypes = [NotmuchMessagesP]
\r
97 _move_to_next.restype = None
\r
100 + def __next__(self):
\r
101 if self._msgs is None:
\r
102 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
104 @@ -169,6 +169,7 @@ class Messages(object):
\r
105 msg = Message(Messages._get(self._msgs), self)
\r
106 self._move_to_next(self._msgs)
\r
108 + next = __next__ # python2.x iterator protocol compatibility
\r
110 def __nonzero__(self):
\r
112 diff --git a/bindings/python/notmuch/tag.py b/bindings/python/notmuch/tag.py
\r
113 index 2fb7d32..d42ba77 100644
\r
114 --- a/bindings/python/notmuch/tag.py
\r
115 +++ b/bindings/python/notmuch/tag.py
\r
116 @@ -89,7 +89,7 @@ class Tags(object):
\r
117 _move_to_next.argtypes = [NotmuchTagsP]
\r
118 _move_to_next.restype = None
\r
121 + def __next__(self):
\r
122 if self._tags is None:
\r
123 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
124 if not self._valid(self._tags):
\r
125 @@ -98,6 +98,7 @@ class Tags(object):
\r
126 tag = Tags._get(self._tags).decode('UTF-8')
\r
127 self._move_to_next(self._tags)
\r
129 + next = __next__ # python2.x iterator protocol compatibility
\r
131 def __nonzero__(self):
\r
132 """Implement bool(Tags) check that can be repeatedly used
\r
133 diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py
\r
134 index 5058846..39285d6 100644
\r
135 --- a/bindings/python/notmuch/thread.py
\r
136 +++ b/bindings/python/notmuch/thread.py
\r
137 @@ -116,7 +116,7 @@ class Threads(object):
\r
138 _move_to_next.argtypes = [NotmuchThreadsP]
\r
139 _move_to_next.restype = None
\r
142 + def __next__(self):
\r
143 if self._threads is None:
\r
144 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
146 @@ -127,6 +127,7 @@ class Threads(object):
\r
147 thread = Thread(Threads._get(self._threads), self)
\r
148 self._move_to_next(self._threads)
\r
150 + next = __next__ # python2.x iterator protocol compatibility
\r
153 """len(:class:`Threads`) returns the number of contained Threads
\r