Re: Hi all
[notmuch-archives.git] / 47 / 1e0f9a49ce8c8da8214ee53706bd2d2fcea068
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
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\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
42 Message-Id:\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
45 In-Reply-To:\r
46  <1323860305-15802-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
47 References:\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
51 Precedence: list\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
62 \r
63 ---\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
69 \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
77  \r
78 -    def next(self):\r
79 +    def __next__(self):\r
80          if self._files_p is None:\r
81              raise NotmuchError(STATUS.NOT_INITIALIZED)\r
82  \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
86          return file\r
87 +    next = __next__ # python2.x iterator protocol compatibility\r
88  \r
89      def __len__(self):\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
98  \r
99 -    def next(self):\r
100 +    def __next__(self):\r
101          if self._msgs is None:\r
102              raise NotmuchError(STATUS.NOT_INITIALIZED)\r
103  \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
107          return msg\r
108 +    next = __next__ # python2.x iterator protocol compatibility\r
109  \r
110      def __nonzero__(self):\r
111          """\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
119  \r
120 -    def next(self):\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
128          return tag\r
129 +    next = __next__ # python2.x iterator protocol compatibility\r
130  \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
140  \r
141 -    def next(self):\r
142 +    def __next__(self):\r
143          if self._threads is None:\r
144              raise NotmuchError(STATUS.NOT_INITIALIZED)\r
145  \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
149          return thread\r
150 +    next = __next__ # python2.x iterator protocol compatibility\r
151  \r
152      def __len__(self):\r
153          """len(:class:`Threads`) returns the number of contained Threads\r
154 -- \r
155 1.7.7.3\r
156 \r