[notmuch] [PATCH] SWIG bindings
Ben Gamari
bgamari.foss at gmail.com
Mon Jan 25 19:53:17 PST 2010
Hey all,
Here's the latest version of my patch adding SWIG interface generation to
notmuch. It has been rebased on the shared-library patches I sent over earlier
this week, so you'll need those as well. Unfortunately, SWIG has effectively no
support for exposing notmuch's C-style object-oriented interface in a
reasonable manner. Therefore, I use SWIG to generate a set of low-level
bindings which is then wrapped with a light-weight module properly exposing the
functions in their intended class structure. This seems like a fairly good
solution, given the wide variety of capabilities possessed by modern high-level
languages.
As you can see, it all works quite nicely,
[2252 ben at ben-laptop swig(swig)] $ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from notmuch import Database
>>> db=Database.open('/home/ben/.mail', Database.MODE_READ_ONLY)
>>> for tag in db.get_all_tags(): print tag
...
attachment
inbox
unread
Let me know what you think. Thanks!
- Ben
More information about the notmuch
mailing list