aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
Commit message (Collapse)AuthorAge
* version: bump to 0.9Gravatar David Bremner2011-10-11
| | | | also bump python bindings version.
* version: bump to 0.9~rc2Gravatar David Bremner2011-10-07
| | | | We continue to keep the python bindings version in sync manually
* python: Set status in the class definitionsGravatar Sebastian 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_initializedGravatar Sebastian 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 documentationGravatar Sebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: whitespace fixed in docstringsGravatar Sebastian Spaeth2011-10-05
| | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Add the new exception types in the API documentationGravatar Sebastian 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 changesGravatar Sebastian 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.2Gravatar Sebastian 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 quotingGravatar Ali 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*Gravatar 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 styleGravatar Ali Polatel2011-10-04
| | | | No functional change, just indentation
* ruby: Add wrappers for database_find_message*Gravatar 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()Gravatar 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 SubclassesGravatar Sebastian 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 classesGravatar Justus 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()Gravatar 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 documentationGravatar Sebastian 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 documentationGravatar Sebastian 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 bindingsGravatar Justus 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_messagesGravatar Justus 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_initializedGravatar Justus 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_initializedGravatar Justus 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 == NoneGravatar Justus 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 NotmuchErrorGravatar Justus 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 oneGravatar Justus 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 bindingsGravatar Sebastian 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 bindingsGravatar Sebastian Spaeth2011-09-28
| | | | | | Add it :-) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* version: bump to 0.9~rc1Gravatar David Bremner2011-09-24
| | | | | This version number change should not be taken as definitive, rather refer to the signed tag.
* ruby: New exception Notmuch::UnbalancedAtomicErrorGravatar Ali Polatel2011-09-24
| | | | | This exception wraps NOTMUCH_STATUS_UNBALANCED_ATOMIC which was added with the commit e59cc0031fbf84f49e32dedb9927f427d2c49309.
* ruby: Wrap notmuch_database_{begin,end}_atomicGravatar Ali 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!Gravatar 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 libnotmuchGravatar Martin 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.8Gravatar David Bremner2011-09-10
| | | | See commit 6979b65 for more discussion.
* update versions for release candidateGravatar David 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.
* python: Make Database take unicode pathsGravatar Sebastian Spaeth2011-09-05
| | | | | | | | Decode and Encode from/to unicode objects as required to be able to take unicode path names. Previously we would error out when an unicode object were handed it. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Have setup.py read the version number without importingGravatar Sebastian Spaeth2011-08-24
| | | | | | | | | | | | | | Importing the notmuch module in setup.py is a no-no, and we want to auto-generate the version number in the release process. Outsource __VERSION__ to the new version.py which contains nothing else and which can therefor easily be autogenerated. Have setup.py read in the file via execfile and test if importing the version number actually worked. This should make all happy. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Updated development status and wording in setup.pyGravatar Sebastian Spaeth2011-08-24
| | | | | | | We are beyond pre-alpha, and the Requirements wording could take some tweaking. Done. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Revert "python: Simplify setup.py"Gravatar Sebastian Spaeth2011-08-24
| | | | | | | | | | | | This reverts commit 8826fc2d7b4e59afdd8cea06891a0c43245340c5. It seems that importing the module in setup.py is controversial at best, as it will fail for users that don't have all dependencies installed. This was the case in e.g. the Ubuntu autobuilder, so building notmuch failed. The plan is to create an autogenerated setup.py that can be used for version information. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Simplify setup.pyGravatar Sebastian Spaeth2011-08-23
| | | | | | | | | We were using a template setup.py which parsed __init__.py in complex ways just to find out the version number. Simply import notmuch and use __VERSION__ directly. Also adapt some wording and setup.py values while going through. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Fix unsafe utf-8 decodingsGravatar pazz2011-08-17
| | | | | | | | This prevents unsafe calls to decode for return value None in get_authors/get_subject which would current throw an Exception. Original patch modified by Sebastian Spaeth. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* decode headers from utf-8 to unicodeGravatar patrick2011-08-15
| | | | | as mail headers are stored as utf-8 in the index, it is safe to return them as unicode strings directly
* python: remove Tags().__len__() implementationGravatar Sebastian Spaeth2011-08-09
| | | | | | | | | | | len() exhausts the tag iterator and e.g. list() or "".join(tags) implicitly call len() if existing and then failing. So, we remove Tags.__len__(). If you need to know the number of tags a message has, do use len(list(tags)). It would be nicer to be able to support len() directly... Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Do explicitly check if the next tag existsGravatar Sebastian Spaeth2011-08-09
| | | | | | | | If we try to pull a non-existing tag, Tags._get will return None and the appended .decode() command will fail. So make sure that there is a tag to be fetched before fetching it. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: pep8 compliance for __init__.pyGravatar pazz2011-08-09
|
* python: pep8 compliance for thread.pyGravatar pazz2011-08-09
|
* python: pep8 compliance for tag.pyGravatar pazz2011-08-09
|
* python: pep8 compliance for globals.pyGravatar pazz2011-08-09
|
* python: pep8 compliance for filename.pyGravatar pazz2011-08-09
|
* python: pep8 compliance for database.pyGravatar pazz2011-08-09
|