unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] SWIG bindings
@ 2010-01-26  3:53 Ben Gamari
  2010-01-26  3:53 ` [PATCH] Add SWIG interface file Ben Gamari
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Gamari @ 2010-01-26  3:53 UTC (permalink / raw)
  To: notmuch


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@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-26  6:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-26  3:53 [PATCH] SWIG bindings Ben Gamari
2010-01-26  3:53 ` [PATCH] Add SWIG interface file Ben Gamari
2010-01-26  5:38   ` Ben Gamari
2010-01-26  6:15     ` [PATCH] Build and link against notmuch shared library Ben Gamari

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).