aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/notmuch/globals.py
Commit message (Collapse)AuthorAge
* python: add a file abstracting away differences between python 2 and 3Justus Winter2012-05-17
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* lib: Bump SO version from 2.0.0 to 3.0.0Austin Clements2012-05-05
| | | | | | | We've changed the APIs of notmuch_database_open, notmuch_database_create, and notmuch_database_close. Amended by db: also bump string in bindings/python/notmuch/globals.py
* python: strip superfluous single quote from copyright noticesJustus Winter2012-04-29
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: move the exception classes into error.pyJustus Winter2012-02-23
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* py3k: add a specialized version of _str for python3Justus Winter2012-01-16
| | | | | | | All strings are unicode strings in python 3 and the basestring and unicode types are removed hence the need for a specialized version. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* 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.
* py3k: All strings are unicode strings in py3kJustus Winter2012-01-02
|
* use __unicode__ for string representationPatrick Totzke2011-12-06
|
* remove unused importsPatrick Totzke2011-12-06
|
* pep8 fixesPatrick Totzke2011-12-06
| | | | no changes to the code, only fixed stuff denounced by `pep8 *py`
* python: add classes to wrap all notmuch_*_t typesJustus Winter2011-12-01
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Set status in the class definitionsSebastian Spaeth2011-10-05
| | | | | | | | | | Technically, this is a superfluous change, as the self.status variable currently gets set in NotmuchErrors's __new__ function. However, in the long run I would like to get rid of the weird __new__ implementation which might be somewhat confusing for users (NotmuchError(status) returns a different class, e.g. OutOfMemoryError) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Catch up with find_message(by_filename) API changesSebastian Spaeth2011-10-05
| | | | | | | message is now an out parameter, and we get an additional status code as a result. Hurray \o/. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: also use libnotmuch.so.2Sebastian Spaeth2011-10-05
| | | | | | | | Catch up with the major version bump. I wonder if this could somehow be automatically made the correct version number. Oh well, I hope it doesn't change too often :-). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: rework creating of SubclassesSebastian Spaeth2011-09-30
| | | | | | | | | | | Add some smart magic, so that when we invoke a NotmuchError(STATUSVALUE), a nicely derived subclass is created, e.g. a OutOfMemoryError. This way users can easily distinguish between error types, while still catching NotmuchError. I have tested this, and hope it works for others too. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: provide more exception classesJustus Winter2011-09-30
| | | | | | | | | | | | | | | | | To make the exception handling more effective in code using the python bindings it is necessary to differentiate between the different kind of failures. Add an exception class for each status code and add a decode classmethod to the NotmuchError class that acts as a factory. Import the new classes in __init__.py so they can be easily imported by anyone. Patch modifed by Sebastian Spaeth. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: fix NotmuchError.__str__ if status == NoneJustus Winter2011-09-29
| | | | | | | Passing None to STATUS.status2str raises an ArgumentError. Add a check for this case and provide a generic message. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: add status and message attributes to NotmuchErrorJustus Winter2011-09-29
| | | | | | | Providing exception objects with meaningful attribute names is much nicer than using e.args[]. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: add begin|end_atomic bindingsSebastian Spaeth2011-09-28
| | | | | | | | | * Add UNBALANCED_ATOMIC status code Catch up with the notmuch status codes, and add the UNBALANCED_ATOMIC one. * Add the begin_atomic and end_atomic calls to libnotmuch Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Ensure that we pass utf-8 encoded string to libnotmuchMartin Owens2011-09-16
| | | | | | | | | | | | If we use unicode objects, libnotmuch would not cope with null bytes in the byte array, so we need to make sure they are nicely formatted as utf-8. Introduce a helper function _str which does this throughout the code. Patch slightly modified by Sebastian Spaeth. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: pep8 compliance for globals.pypazz2011-08-09
|
* python: Improve API documentationSebastian Spaeth2011-06-16
| | | | | | Various API doc cleanups and improvements. No code change. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move everything down into a bindings/python directory.Carl Worth2010-04-21
In preparation for merging the python bindings into the notmuch repository.