aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/notmuch/filename.py
Commit message (Collapse)AuthorAge
* python: rename filename.py into filenames.pyJustus Winter2012-02-22
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the python bindingsJustus Winter2012-02-22
| | | | | | | | Move the Directory class into its own file, merge the two Filenames classes into one, deprecate Filenames.as_iterator, update the documentation accordingly. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: refactor the error handling machineryJustus Winter2012-02-20
| | | | | | | | Raise specific error classes instead of a generic NotmuchError with an magic status value (e.g. NotmuchError(STATUS.NULL_POINTER) -> NullPointerError()), update the documentation accordingly. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: more error handling fixesJustus Winter2012-02-19
| | | | | | | This is a follow up commit to 221c7e0b38177f5f1dbf0561580c15e8aaa49004 fixing more NULL pointer checks. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove unused but imported symbolJustus Winter2012-02-18
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix error handlingJustus Winter2012-01-22
| | | | | | | | | | | Before 3434d1940 the return values of libnotmuch functions were declared as c_void_p and the code checking for errors compared the returned value to None, which is the ctypes equivalent of a NULL pointer. But said commit wrapped all the data types in python classes and the semantic changed in a subtle way. If a function returns NULL, the wrapped python value is falsish, but no longer equal to None.
* python: str.decode() doesn't like kwargs in python 2.5Sebastian Spaeth2012-01-02
| | | | | | | | | Recent changes introduced lots of unicodification of strings, mostly in the form of .decode('utf-8', errors='ignore'). However, python 2.5 does not like the errors keyword argument and complains. It does work when used as a simple arg though, so that's what this patch does. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: add missing conversions from and to utf-8Justus Winter2012-01-02
|
* py3k: Add and use a mixin class that implements __str__Justus Winter2012-01-02
| | | | | Amended by Sebastian Spaeth <Sebastian@SSpaeth.de> to include the required sys import in globals.py.
* use __unicode__ for string representationPatrick Totzke2011-12-06
|
* remove unused importsPatrick Totzke2011-12-06
|
* python: annotate all calls into libnotmuch with typesJustus Winter2011-12-01
| | | | | | | | | | | Add type information to the ctypes._FuncPtr wrappers and use the wrapper classes instead of c_void_p for pointers to notmuch_*_t. This enables the ctypes library to type check parameters being handed to functions from the notmuch library. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix Message.get_filenames()Thomas Jost2011-10-01
| | | | | | | 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.
* properly raise exceptions in python bindingsJustus Winter2011-09-29
| | | | | | | There are various locations where exceptions are constructed but not raised. This patch adds the necessary raise statements. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: pep8 compliance for filename.pypazz2011-08-09
|
* bindings/python: Implement Message().get_filenames()Sebastian Spaeth2011-06-02
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>