aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
Commit message (Collapse)AuthorAge
* 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
|
* python: pep8 compliance for message.pyGravatar pazz2011-08-09
|
* python: Really throw an error if search_threads() failsGravatar Sebastian Spaeth2011-08-09
| | | | | | | | | | | | In case, search_threads returns an error we are supposed to throw an Exception. But we did not "raise" it, this was an oversight and this commit fixes it. There is still the problem that there is often output to stderr by libnotmuch detailing the xapian error and this is simply printed out. But this requires fixing at the libnotmuch level... Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Fix copy'n paste typoGravatar Cedric Cabessa2011-08-09
| | | | | | | we accessed a wrong attribute due to a copy and paste error. Thanks for catching this. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* ruby: Fix typo in documentationGravatar Ali Polatel2011-07-29
| | | | It's Notmuch::FileNames not Notmuch::Filenames
* ruby: Remove the split file hack from rdoc.shGravatar Ali Polatel2011-07-29
|
* ruby: Add markers to method definitions to help rdocGravatar Ali Polatel2011-07-29
| | | | | rdoc is dumb and needs markers in method definitions so that she can find which source file the method is defined in
* ruby: Document remaining undocumented constantsGravatar Ali Polatel2011-07-29
|
* ruby: Document constants and exceptions right before definitionGravatar Ali Polatel2011-07-29
|
* ruby: Add list of classes to main documentationGravatar Ali Polatel2011-07-29
|
* python: represent message tags as unicode instancesGravatar Sebastian Spaeth2011-07-11
| | | | | | | | | | | | Rather than returning simply strings and having to guess their encoding, return explicit unicode() strings for the tags. Xapian stores UTF8, so we know that they come as UTF8 encoded string. Note: I tried to directly use the c_wchar_p type of the ctypes library which translates directly into an unicode type, but that did not work out so well, so we take c_char_p and .decode() them manually. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Encode query string as a utf-8 byte arrayGravatar Sebastian Spaeth2011-07-11
| | | | | | | | | If we pass in an unicode instance as query string, we would probably get weird behavior (and indeed do so, see mail id:"20110707113700.GA16347@megatron"). If a unicode instance is passed in, make sure we encode it properly to an utf-8 encoded byte string. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Fix Database().needs_upgrade()Gravatar Sebastian Spaeth2011-07-08
| | | | | | | | | A stupid typo was preventing this from ever working and it was not detected until now. Patrick noted the typo and proposed the fix in mail id:"20110704203926.GA20238@brick.lan". Patch-by: Patrick Totzke <patricktotzke@googlemail.com> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Do not implicitely call maildir_flags_to_tags etcGravatar Sebastian Spaeth2011-06-24
| | | | | | | | | | In order to remain consistent with the underlying C API, we do not automatically synchronize notmuch tags and maildir flags anymore. The underlying functions Message.maildir_flags_to_tags and Message.tags_to_maildir_flags still exist and are available to the user. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Do not import notmuch in setup.py.Gravatar David Bremner2011-06-20
| | | | | | Importing notmuch loads the notmuch shared library. When building without a system install of notmuch, this requires e.g. setting LD_LIBRARY_PATH for building and fails completely for cleaning.
* Simplify (& fix) Message().__str__()Gravatar Sebastian Spaeth2011-06-16
| | | | | | | | | | | | We were still using len(self.get_replies()) for the __str__ summary of a mail, but 1) len(Messages()) has just gone away 2) the number of replies can not be retrieved when we got the message via search_messages() anyway, and 3) it is likely quite expensive to pull all replies for all messages that we display a summary of. So we fix this by simplifying str(Message()) to omit the number of replies. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Bulletproof Database() path parameterGravatar Sebastian Spaeth2011-06-16
| | | | | | | | | | libnotmuch (and python) crashed when I accidently passed in an invalid value as path argument to the Database() instantiation. Therefore, we now check via assert that the handed in path is actually a real string (or None). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Improve API documentationGravatar Sebastian Spaeth2011-06-16
| | | | | | Various API doc cleanups and improvements. No code change. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Implement Message.tags_to_maildir_flagsGravatar Sebastian Spaeth2011-06-16
| | | | | | | | | and also maildir_flags_to_tags. The methods will be invoked by db.add_message() and also (if not overridden via function parameter) by add|remove_tag and remove_all_tags. Documentation on the usage has been updated. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Improve documentationGravatar Sebastian Spaeth2011-06-15
| | | | | | | | Improve the documentation with regard to the new __cmp__ and __hash__ methods and the implications of doing set arithmetic with Messages() objects. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Implement Message.__cmp__ and __hash__Gravatar Sebastian Spaeth2011-06-15
| | | | | | | | | | We can now do: if msg1 == msg2, and we can use set arithmetic on Messages(): s1, s2= msgs1, msgs2 s1.union(s2) s2 -= s1 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Remove Messages().__len__Gravatar Sebastian Spaeth2011-06-15
| | | | | | | | | | | Messages.__len__() exhausted the iterator and list() inherently calls len(), so we could not invoke list(msgs) without getting errors. Fix this by implementing __nonzero__ but removing __len__ on Messages. Use Query.count_messages() or len(list(msgs)) if you need to know the number. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* bindings/python: Bump bindings version to 0.6Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | To match the upcoming release, and with the updated API to match the current libnotmuch, bump the python version number (notmuch.__VERSION__) to 0.6. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* bindings/python: Implement Tags().__nonzero__()Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | Analog to Threads.__nonzero__ this allows us to perform list() on a Threads() object and to repeatedly call "if Tags():" or "bool(Tags())" without implicitly invoking len(), thus exhausting our iterator. While touching this code, I added a small micro-optimization to the Tag next() function. There is no need to explicitly check _is_valid, as _get implicitly does check for validness and returns None, if there is no more Tag to fetch. This avoids some roundtrips into the library when iterating through Tags. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* bindings/python: implement Threads().__nonzero__Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | | | | | | __nonzero__ checks if Threads() contains at least one more valid thread The existence of this function makes 'if Threads(): foo' work, as that previously implicitely called len() exhausting the iterator. This function makes `bool(Threads())` work repeatedly. For further info, see http://docs.python.org/reference/datamodel.html. Credits for the hint go to Brian May. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* bindings/python: Include the new get_filenames in the API docsGravatar Sebastian Spaeth2011-06-02
| | | | | | | They had accidentally been left out, so we should also include the function docs for get_messages in the API docs. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* bindings/python: Implement Message().get_filenames()Gravatar 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>
* python: Update README to talkabout notmuch, not cnotmuchGravatar Carl Worth2011-05-24
| | | | | | The old instructions were telling users to do "easy_install cnotmuch" which installed some old, stale bindings. The new instructions should be much more effective.
* python: Remove completed TODO itemGravatar James Vasile2011-03-16
| | | | | | | Really just a left-over TODO item in the code, nothing spectacular to see here. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* update for go-release-2011-02-01:Gravatar Sebastien Binet2011-02-03
| | | | | * M bindings/go/cmds/notmuch-addrlookup.go log.Exitf -> log.Fatalf