once all derived objects are dead.
"""
if files_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._files = files_p
#save reference to parent object so we keep it alive
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