[notmuch] [PATCH] SWIG bindings
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 26 Jan 2010 03:53:17 +0000 (22:53 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:02 +0000 (09:36 -0800)
6b/d1e3b51791eaaa6a402e470ad0c3253544c6c4 [new file with mode: 0644]

diff --git a/6b/d1e3b51791eaaa6a402e470ad0c3253544c6c4 b/6b/d1e3b51791eaaa6a402e470ad0c3253544c6c4
new file mode 100644 (file)
index 0000000..6992de1
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <bgamari.foss@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7B12D431FBC\r
+       for <notmuch@notmuchmail.org>; Mon, 25 Jan 2010 19:53:28 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.499\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.499 tagged_above=-999 required=5\r
+       tests=[AWL=-1.500, BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5U-3YaAVafUL for <notmuch@notmuchmail.org>;\r
+       Mon, 25 Jan 2010 19:53:27 -0800 (PST)\r
+Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com\r
+       [209.85.210.204])\r
+       by olra.theworths.org (Postfix) with ESMTP id 949CD431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 25 Jan 2010 19:53:27 -0800 (PST)\r
+Received: by yxe42 with SMTP id 42so1974332yxe.22\r
+       for <notmuch@notmuchmail.org>; Mon, 25 Jan 2010 19:53:27 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:received:received:from:to:subject:date\r
+       :message-id:x-mailer;\r
+       bh=05I21vRh7k0mZpRvprY8Dk7JKoOR3yyz1iNO13q88Ys=;\r
+       b=sXG64EIVnN6ngUE1jNedEZGT5w9LR7CJWchBrK3+Tgv6nKyHajLGNdlT0ZTbdXB3f5\r
+       VqJxSVOIqc0u9b4DNDlroGA2Puo/TPwidOEXfzlGeQKS8PnWQ0ba50Ud+6iL2ScoOAYy\r
+       2ny2qo0qpvRTAj5QvcHe+/FVWVTCfpyDwvmic=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer;\r
+       b=GeEV926Tc4o0P8dIiGqSx8yjTrF4uF1Juytwgv0dU8SkoeCZFrlFl2Pb2P3T1Z98lu\r
+       p3W55/QVl5lLv8exm3TueZ6IVwYz2yaARXtKuHBMuCuVk6hrcnmeYvRYpeGS/k8DXsZM\r
+       ZXEH7uHhzUq9gCZPqdx3JkT7SKGAqfdNsFhGc=\r
+Received: by 10.151.92.9 with SMTP id u9mr9768025ybl.158.1264478007176;\r
+       Mon, 25 Jan 2010 19:53:27 -0800 (PST)\r
+Received: from localhost.localdomain (umass-959-100.wireless.umass.edu\r
+       [128.119.77.100])\r
+       by mx.google.com with ESMTPS id 9sm1980893ywe.26.2010.01.25.19.53.25\r
+       (version=SSLv3 cipher=RC4-MD5); Mon, 25 Jan 2010 19:53:26 -0800 (PST)\r
+From: Ben Gamari <bgamari.foss@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Mon, 25 Jan 2010 22:53:17 -0500\r
+Message-Id: <1264477998-20681-1-git-send-email-bgamari.foss@gmail.com>\r
+X-Mailer: git-send-email 1.6.3.3\r
+Subject: [notmuch] [PATCH] SWIG bindings\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 26 Jan 2010 03:53:28 -0000\r
+\r
+\r
+Hey all,\r
+\r
+Here's the latest version of my patch adding SWIG interface generation to\r
+notmuch. It has been rebased on the shared-library patches I sent over earlier\r
+this week, so you'll need those as well. Unfortunately, SWIG has effectively no\r
+support for exposing notmuch's C-style object-oriented interface in a\r
+reasonable manner. Therefore, I use SWIG to generate a set of low-level\r
+bindings which is then wrapped with a light-weight module properly exposing the\r
+functions in their intended class structure. This seems like a fairly good\r
+solution, given the wide variety of capabilities possessed by modern high-level\r
+languages.\r
+\r
+As you can see, it all works quite nicely,\r
+\r
+    [2252 ben@ben-laptop swig(swig)] $ python \r
+    Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) \r
+    [GCC 4.4.1] on linux2\r
+    Type "help", "copyright", "credits" or "license" for more information.\r
+    >>> from notmuch import Database\r
+    >>> db=Database.open('/home/ben/.mail', Database.MODE_READ_ONLY)\r
+    >>> for tag in db.get_all_tags(): print tag\r
+    ... \r
+    attachment\r
+    inbox\r
+    unread\r
+    \r
+Let me know what you think. Thanks!\r
+\r
+- Ben\r