aboutsummaryrefslogtreecommitdiff
path: root/bindings
Commit message (Collapse)AuthorAge
* python: Remove stray debug commentSebastian Spaeth2011-12-06
| | | | | | This slipped in wrongly in commit 71e0082eff (due to my fault). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: use wrapped notmuch_*_t types instead of raw pointersThomas Jost2011-12-06
| | | | | | | | Now that types are checked correctly, we also need to make sure that all the arguments actually are instances of these types. Otherwise the function calls will fail and raise an exception similar to this one: ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected LP_LP_NotmuchMessageS instance instead of pointer to c_void_p
* errors='ignore' when decode to unicodePatrick Totzke2011-12-06
|
* use __unicode__ for string representationPatrick Totzke2011-12-06
|
* clean up Thread.__str__Patrick Totzke2011-12-06
|
* python: Return a STATUS value in tags_to_flags and flags_to_tagsSebastian Spaeth2011-12-06
| | | | | | | We were not returning anything at all, which does not match the API documentation. Fixed. Thanks to Patrick Totzke for the heads up. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* remove unused importsPatrick Totzke2011-12-06
|
* fix sphinx compile-time warningsPatrick Totzke2011-12-06
| | | | | no changes to the code, only makes compiling the docs smoother as some rsT syntax errors were fixed
* pep8 fixesPatrick Totzke2011-12-06
| | | | no changes to the code, only fixed stuff denounced by `pep8 *py`
* 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: add classes to wrap all notmuch_*_t typesJustus Winter2011-12-01
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* version: update to 0.10.1David Bremner2011-11-25
|
* version: update to 0.10David Bremner2011-11-23
|
* version: update version info for 0.10~rc2David Bremner2011-11-19
| | | | | Arguably editing debian/changelog violates the "do one thing at a time" rule, but all of these versions need to be kept in sync.
* version: update to 0.10~rc1David Bremner2011-11-15
| | | | and the usual dance with the python bindings version.
* version: bump to 0.9David Bremner2011-10-11
| | | | also bump python bindings version.
* version: bump to 0.9~rc2David Bremner2011-10-07
| | | | We continue to keep the python bindings version in sync manually
* 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: help function Query._assert_query_is_initializedSebastian Spaeth2011-10-05
| | | | | | | | Remove code duplication by using the new helper function. Also raise the new fine grained exceptions in many cases, rather than the more generic NotmuchErrors. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: clean up docstrings and API documentationSebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: whitespace fixed in docstringsSebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Add the new exception types in the API documentationSebastian Spaeth2011-10-05
| | | | | | as they should be documented... 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>
* ruby: Fix macros, use quotingAli Polatel2011-10-04
| | | | | | Fix Data_Get_Notmuch_* macro definitions broken by prev. commit Adequate quoting for Data_Get_Notmuch_* macros Remove duplicated RSTRING_PTR() macros, move it to defs.h
* ruby: Really add wrappers for database_find_message*Ali Polatel2011-10-04
| | | | | | Commit 898613116db746aa0f915ae43da8aba28545203d only added wrapper functions but did not register them. Register the functions in module's initialization function.
* ruby: be consistent with notmuch's coding styleAli Polatel2011-10-04
| | | | No functional change, just indentation
* ruby: Add wrappers for database_find_message*Ali Polatel2011-10-04
| | | | | | Two new wrappers: Notmuch::Database.find_message(id) => Notmuch::Message or nil Notmuch::Database.find_message_by_filename(path) => Notmuch::Message or nil
* 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.
* 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 docstring of Message.get_header()Justus Winter2011-09-30
| | | | | | Update the docstring from notmuch.h. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: Add new functions in API documentationSebastian Spaeth2011-09-29
| | | | | | | Add documentation for the three new functions and add in which version they have been added. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Improve code documentationSebastian Spaeth2011-09-29
| | | | | | | | 1) Fix added .gitignore from commit dc8a1745 to work on the docs folder 2) Improve in-code developer documentation to produce better sphinx-generated documentation. No code changes. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* 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: raise a more specific error in Messages.print_messagesJustus Winter2011-09-29
| | | | | | | | | | | Raising Exception is considered bad since the only way to catch it is to do 'except Exception'. Raising a TypeError is more appropriate. Since the format parameter has already been validated, checking it again is not necessary. Simplify this conditional. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: rename _verify_dir_initialized to _assert_dir_is_initializedJustus Winter2011-09-29
| | | | | | | | | | | Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Modified by Sebastian Spaeth to apply cleanly again and remove some blank lines. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: rename _verify_initialized_db to _assert_db_is_initializedJustus Winter2011-09-29
| | | | | | | | | | | Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Modified slightly by Sebastian Spaeth to catch all new instances and remove some blank lines too. 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 a .gitignore file and refine the toplevel oneJustus Winter2011-09-29
| | | | | | | | | | | | The line 'notmuch' in the toplevel .gitignore file is to broad and matches bindings/python/notmuch making it cumbersome to git-add files within that directory. Refine the toplevel file to only match the generated notmuch executable and add a more specialized .gitignore file to the python directory. 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: Add database_find_message_by_filename bindingsSebastian Spaeth2011-09-28
| | | | | | Add it :-) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* version: bump to 0.9~rc1David Bremner2011-09-24
| | | | | This version number change should not be taken as definitive, rather refer to the signed tag.
* ruby: New exception Notmuch::UnbalancedAtomicErrorAli Polatel2011-09-24
| | | | | This exception wraps NOTMUCH_STATUS_UNBALANCED_ATOMIC which was added with the commit e59cc0031fbf84f49e32dedb9927f427d2c49309.
* ruby: Wrap notmuch_database_{begin,end}_atomicAli Polatel2011-09-24
| | | | | | | | | | | Adding ruby wrappers for functions: - notmuch_database_begin_atomic() - notmuch_database_end_atomic() added by 957f1ba3fc1d737887029ff1787fc6bea94de00b New functions: Notmuch::Database.begin_atomic() Notmuch::Database.end_atomic()
* ruby: Rename destroy to destroy!Ali Polatel2011-09-24
| | | | | | | | | | | | | | | | | According to the common Ruby function naming convention, potentially dangerous functions or functions which operate on the object itself are suffixed with an exclamation mark. Both of these are true for object destroying functions. The following modules are affected: - Notmuch::Directory - Notmuch::FileNames - Notmuch::Query - Notmuch::Threads - Notmuch::Thread - Notmuch::Messages - Notmuch::Message - Notmuch::Tags
* 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>
* update versions for release 0.8David Bremner2011-09-10
| | | | See commit 6979b65 for more discussion.
* update versions for release candidateDavid Bremner2011-09-06
| | | | | | | | | | we now have three files to keep in sync. That seems wrong, but I guess we will live with it for now. The main problem is that the python code is distributed separately, so it can't get the version from 'version'. The choice ~rcX is for convenience with debian versioning.