aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
Commit message (Collapse)AuthorAge
* 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
* ruby: Add generated files to .gitignoreGravatar Ali Polatel2011-02-03
|
* Migrate to goconfig pkgGravatar Sebastien Binet2011-01-26
|
* bindings/go: Add a todo fileGravatar Sebastien Binet2011-01-26
|
* A minor, cosmetic changeGravatar Sebastien Binet2011-01-26
| | | | Just trying to keep the line lengths in check.
* Initial import of Go bindings for notmuchGravatar Sebastien Binet2011-01-26
|
* ruby: Add wrapper for message_get_filenamesGravatar Ali Polatel2011-01-25
|
* ruby: Add wrappers for maildir sync. interfaceGravatar Ali Polatel2011-01-25
| | | | | | New wrappers: notmuch_message_maildir_flags_to_tags(): MESSAGE.maildir_flags_to_tags notmuch_message_tags_to_maildir_flags(): MESSAGE.tags_to_maildir_flags
* ruby: Add wrappers for query_get_s{ort,tring}Gravatar Ali Polatel2011-01-25
| | | | | | New wrappers: notmuch_query_get_sort(): QUERY.sort notmuch_query_get_query_string(): QUERY.to_s
* python: Update metainformation to point to new URL and version numberGravatar Sebastian Spaeth2011-01-13
| | | | | | | | | | | | | Convert the meta information to point to the notmuchmail.org repository, rather than the old cnotmuch location. I will delete the "cnotmuch" package from http://pypi.python.org/pypi/cnotmuch and create a new "notmuch" package there that contains the current versions. Also bump the version number to 0.4. I will need to upgrade the API first before I can release the 0.5 of the bindings, there are still some methods missing. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Merge in ruby bindings.Gravatar Carl Worth2010-11-08
|\ | | | | | | | | | | | | Thanks to Ali Polatel for these bindings. This code was fetched from the ruby branch of: git://github.com/alip/notmuch.git
* | python: lambda(p) is not P3k-compliantGravatar Sebastian Spaeth2010-10-28
| | | | | | | | Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | python: Import explicit including package nameGravatar Sebastian Spaeth2010-10-28
| | | | | | | | | | | | To make python3 happy Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * ruby: Don't barf if an object is destroyed more than onceGravatar Ali Polatel2010-06-06
| | | | | | | | | | | | Raise RuntimeError instead. Also revise Notmuch::Database a bit. Add Notmuch::Database.open singleton method.
| * ruby: Use rb_scan_args()Gravatar Ali Polatel2010-06-06
| |
| * ruby: Kill garbage collection related cruft.Gravatar Ali Polatel2010-06-06
| | | | | | | | | | | | | | Let the user destroy objects that she wants explicitly. It's not possible to specify the order objects are garbage collected. See id:86y6f8v838.fsf@harikalardiyari.ev on ruby-talk for more information.
| * ruby: First attempt at fixing gc for ruby-1.9Gravatar Ali Polatel2010-06-06
| |
| * ruby: fix documentation of DB.upgrade!Gravatar Ali Polatel2010-06-06
| |
| * Initial ruby bindingsGravatar Ali Polatel2010-06-06
|/
* python: have docs reflect current return value behaviorGravatar Sebastian Spaeth2010-05-18
| | | | | | | | | | | | Database.find_message() used to be able to reliably indicate whether a message exists or not (in which case it returns None). However, the recent API change of the notmuch library means we will return None even for all Xapian exceptions, which happens e.g. when the current Database has been modified by another project. Therefore the return value of None cannot be reliably be used to indicate whether a message exists or not. Make the docs state that explicitely. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Add UNSORTED as Query.SORT optionGravatar Sebastian Spaeth2010-04-23
| | | | | | Keep up to date with the libnotmuch.so API. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* python: Delete unused filesGravatar Sebastian Spaeth2010-04-23
| | | | | | | | No more .hg files needed in the git repo. No stock notmuch-test suite needed in a subdirectory. We have the real one in this repository Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Move everything down into a bindings/python directory.Gravatar Carl Worth2010-04-21
In preparation for merging the python bindings into the notmuch repository.