1 Return-Path: <schnouki@schnouki.net>
\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 98FFB431FD0
\r
6 for <notmuch@notmuchmail.org>; Fri, 30 Sep 2011 03:17:05 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]
\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 Ao3TbxWQgW+d for <notmuch@notmuchmail.org>;
\r
17 Fri, 30 Sep 2011 03:17:03 -0700 (PDT)
\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])
\r
19 by olra.theworths.org (Postfix) with ESMTP id 6B067431FB6
\r
20 for <notmuch@notmuchmail.org>; Fri, 30 Sep 2011 03:17:03 -0700 (PDT)
\r
21 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])
\r
22 by ks3536.kimsufi.com (Postfix) with ESMTPSA id 1686E6A069B;
\r
23 Fri, 30 Sep 2011 12:17:01 +0200 (CEST)
\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;
\r
25 s=key-schnouki; t=1317377821;
\r
26 bh=bNbNoZdA5DRCJR8sCBRtVdRRY67iYkU5mEXCnUpoUY8=;
\r
27 h=From:To:Subject:Date:Message-Id;
\r
28 b=XoVcF6XvD2SCl4S3qFbD+yhYQYyWAQPYbq401IyTDWCx+XPKQXwv6CV9REVqeeIuH
\r
29 0qf7klkJPCuLnoyCGRWy/KoFhIDneo4o2WtVgjLsv+lsqOZYzkXy6Dw79kecnvwxTY
\r
30 cGEfswcRyJC+Ja4I1HOB3QYOBRuB+7q5scFiBL30=
\r
31 From: Thomas Jost <schnouki@schnouki.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH] python: fix Message.get_filenames()
\r
34 Date: Fri, 30 Sep 2011 12:16:47 +0200
\r
35 Message-Id: <1317377807-20636-1-git-send-email-schnouki@schnouki.net>
\r
36 X-Mailer: git-send-email 1.7.6.4
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Fri, 30 Sep 2011 10:17:05 -0000
\r
51 Previously, the Filenames generator only yielded *one* filename before
\r
52 returning, making Message.get_filenames() behave as Message.get_filename(). This
\r
53 commit fixes this incorrect behavior: now the generator yields all the
\r
54 filenames, as expected.
\r
56 bindings/python/notmuch/filename.py | 10 ++++------
\r
57 1 files changed, 4 insertions(+), 6 deletions(-)
\r
59 diff --git a/bindings/python/notmuch/filename.py b/bindings/python/notmuch/filename.py
\r
60 index 630886d..b44d4c5 100644
\r
61 --- a/bindings/python/notmuch/filename.py
\r
62 +++ b/bindings/python/notmuch/filename.py
\r
63 @@ -82,13 +82,11 @@ class Filenames(object):
\r
64 if self._files is None:
\r
65 raise NotmuchError(STATUS.NOT_INITIALIZED)
\r
67 - if not nmlib.notmuch_filenames_valid(self._files):
\r
68 - self._files = None
\r
70 + while nmlib.notmuch_filenames_valid(self._files):
\r
71 + yield Filenames._get(self._files)
\r
72 + nmlib.notmuch_filenames_move_to_next(self._files)
\r
74 - file = Filenames._get(self._files)
\r
75 - nmlib.notmuch_filenames_move_to_next(self._files)
\r
77 + self._files = None
\r
80 """Represent Filenames() as newline-separated list of full paths
\r