diff options
author | pazz <patricktotzke@gmail.com> | 2011-07-12 21:13:57 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-08-09 17:28:24 +0200 |
commit | 8176326f30e654ab4063d437ada6b9f42c1aff0e (patch) | |
tree | 0d29909a6a3a90ec0429e6ae9cbb7f5ea8986167 /bindings | |
parent | e69e30edd71eb6c7ea3a004e80ff84accbd12199 (diff) |
python: pep8 compliance for filename.py
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/notmuch/filename.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/bindings/python/notmuch/filename.py b/bindings/python/notmuch/filename.py index 20b90e9..630886d 100644 --- a/bindings/python/notmuch/filename.py +++ b/bindings/python/notmuch/filename.py @@ -19,19 +19,20 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>' from ctypes import c_char_p from notmuch.globals import nmlib, STATUS, NotmuchError -#------------------------------------------------------------------------------ + class Filenames(object): """Represents a list of filenames as returned by notmuch - This object contains the Filenames iterator. The main function is as_generator() which will return a generator so we can do a Filenamesth an iterator over a list of notmuch filenames. Do - note that the underlying library only provides a one-time iterator - (it cannot reset the iterator to the start). Thus iterating over - the function will "exhaust" the list of tags, and a subsequent - iteration attempt will raise a :exc:`NotmuchError` - STATUS.NOT_INITIALIZED. Also note, that any function that uses - iteration (nearly all) will also exhaust the tags. So both:: + This object contains the Filenames iterator. The main function is + as_generator() which will return a generator so we can do a Filenamesth an + iterator over a list of notmuch filenames. Do note that the underlying + library only provides a one-time iterator (it cannot reset the iterator to + the start). Thus iterating over the function will "exhaust" the list of + tags, and a subsequent iteration attempt will raise a :exc:`NotmuchError` + STATUS.NOT_INITIALIZED. Also note, that any function that uses iteration + (nearly all) will also exhaust the tags. So both:: - for name in filenames: print name + for name in filenames: print name as well as:: @@ -85,10 +86,10 @@ class Filenames(object): self._files = None return - file = Filenames._get (self._files) + file = Filenames._get(self._files) nmlib.notmuch_filenames_move_to_next(self._files) yield file - + def __str__(self): """Represent Filenames() as newline-separated list of full paths @@ -105,4 +106,4 @@ class Filenames(object): def __del__(self): """Close and free the notmuch filenames""" if self._files is not None: - nmlib.notmuch_filenames_destroy (self._files) + nmlib.notmuch_filenames_destroy(self._files) |