]> git.notmuchmail.org Git - notmuch/commit
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)
commitb31247c354b54a3cbeb1c7f9df830e16f7c921d9
treea7293c6e59274348809cc43e6bd855967e333306
parente2afcd2594add5186234124dd38b4b2aeabca5bd
bindings/python: Implement Message().get_filenames()

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>
bindings/python/notmuch/filename.py [new file with mode: 0644]
bindings/python/notmuch/message.py