[PATCH] python: fix Message.get_filenames()

2011-10-01 Thread Sebastian Spaeth
On Fri, 30 Sep 2011 12:16:47 +0200, Thomas Jost  
wrote:
> Previously, the Filenames generator only yielded *one* filename before
> returning, making Message.get_filenames() behave as Message.get_filename(). 
> This
> commit fixes this incorrect behavior: now the generator yields all the
> filenames, as expected.

APPLIED to master, thanks.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



Re: [PATCH] python: fix Message.get_filenames()

2011-09-30 Thread Sebastian Spaeth
On Fri, 30 Sep 2011 12:16:47 +0200, Thomas Jost  wrote:
> Previously, the Filenames generator only yielded *one* filename before
> returning, making Message.get_filenames() behave as Message.get_filename(). 
> This
> commit fixes this incorrect behavior: now the generator yields all the
> filenames, as expected.

APPLIED to master, thanks.


pgpjjNeiEYSTI.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] python: fix Message.get_filenames()

2011-09-30 Thread Thomas Jost
Previously, the Filenames generator only yielded *one* filename before
returning, making Message.get_filenames() behave as Message.get_filename(). This
commit fixes this incorrect behavior: now the generator yields all the
filenames, as expected.
---
 bindings/python/notmuch/filename.py |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bindings/python/notmuch/filename.py 
b/bindings/python/notmuch/filename.py
index 630886d..b44d4c5 100644
--- a/bindings/python/notmuch/filename.py
+++ b/bindings/python/notmuch/filename.py
@@ -82,13 +82,11 @@ class Filenames(object):
 if self._files is None:
 raise NotmuchError(STATUS.NOT_INITIALIZED)

-if not nmlib.notmuch_filenames_valid(self._files):
-self._files = None
-return
+while nmlib.notmuch_filenames_valid(self._files):
+yield Filenames._get(self._files)
+nmlib.notmuch_filenames_move_to_next(self._files)

-file = Filenames._get(self._files)
-nmlib.notmuch_filenames_move_to_next(self._files)
-yield file
+self._files = None

 def __str__(self):
 """Represent Filenames() as newline-separated list of full paths
-- 
1.7.6.4



[PATCH] python: fix Message.get_filenames()

2011-09-30 Thread Thomas Jost
Previously, the Filenames generator only yielded *one* filename before
returning, making Message.get_filenames() behave as Message.get_filename(). This
commit fixes this incorrect behavior: now the generator yields all the
filenames, as expected.
---
 bindings/python/notmuch/filename.py |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bindings/python/notmuch/filename.py 
b/bindings/python/notmuch/filename.py
index 630886d..b44d4c5 100644
--- a/bindings/python/notmuch/filename.py
+++ b/bindings/python/notmuch/filename.py
@@ -82,13 +82,11 @@ class Filenames(object):
 if self._files is None:
 raise NotmuchError(STATUS.NOT_INITIALIZED)
 
-if not nmlib.notmuch_filenames_valid(self._files):
-self._files = None
-return
+while nmlib.notmuch_filenames_valid(self._files):
+yield Filenames._get(self._files)
+nmlib.notmuch_filenames_move_to_next(self._files)
 
-file = Filenames._get(self._files)
-nmlib.notmuch_filenames_move_to_next(self._files)
-yield file
+self._files = None
 
 def __str__(self):
 """Represent Filenames() as newline-separated list of full paths
-- 
1.7.6.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch