]> git.notmuchmail.org Git - notmuch/commitdiff
bindings/python: Implement Message().get_filenames()
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Thu, 2 Jun 2011 06:56:03 +0000 (08:56 +0200)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Thu, 2 Jun 2011 07:03:18 +0000 (09:03 +0200)
Message().get_filenames() will return a generator that allows to
iterator over the recorded filenames for a certain Message. Do ntoe that
as all generators, these are one-time use only. You will have to reget
them to perform various actions. So this works::

  len(Message().get_filenames())
  list(Message().get_filenames())
  for n in Message().get_filenames():
    print n

But this won't::

  names = Message().get_filenames()
  len(names) #uses up the iterator
  list(names) #outch, already used up...

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>

No differences found