From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7B12D431FBC for ; Mon, 25 Jan 2010 19:53:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.499 X-Spam-Level: X-Spam-Status: No, score=-1.499 tagged_above=-999 required=5 tests=[AWL=-1.500, BAYES_50=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5U-3YaAVafUL for ; Mon, 25 Jan 2010 19:53:27 -0800 (PST) Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com [209.85.210.204]) by olra.theworths.org (Postfix) with ESMTP id 949CD431FAE for ; Mon, 25 Jan 2010 19:53:27 -0800 (PST) Received: by yxe42 with SMTP id 42so1974332yxe.22 for ; Mon, 25 Jan 2010 19:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:x-mailer; bh=05I21vRh7k0mZpRvprY8Dk7JKoOR3yyz1iNO13q88Ys=; b=sXG64EIVnN6ngUE1jNedEZGT5w9LR7CJWchBrK3+Tgv6nKyHajLGNdlT0ZTbdXB3f5 VqJxSVOIqc0u9b4DNDlroGA2Puo/TPwidOEXfzlGeQKS8PnWQ0ba50Ud+6iL2ScoOAYy 2ny2qo0qpvRTAj5QvcHe+/FVWVTCfpyDwvmic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; b=GeEV926Tc4o0P8dIiGqSx8yjTrF4uF1Juytwgv0dU8SkoeCZFrlFl2Pb2P3T1Z98lu p3W55/QVl5lLv8exm3TueZ6IVwYz2yaARXtKuHBMuCuVk6hrcnmeYvRYpeGS/k8DXsZM ZXEH7uHhzUq9gCZPqdx3JkT7SKGAqfdNsFhGc= Received: by 10.151.92.9 with SMTP id u9mr9768025ybl.158.1264478007176; Mon, 25 Jan 2010 19:53:27 -0800 (PST) Received: from localhost.localdomain (umass-959-100.wireless.umass.edu [128.119.77.100]) by mx.google.com with ESMTPS id 9sm1980893ywe.26.2010.01.25.19.53.25 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Jan 2010 19:53:26 -0800 (PST) From: Ben Gamari To: notmuch@notmuchmail.org Date: Mon, 25 Jan 2010 22:53:17 -0500 Message-Id: <1264477998-20681-1-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 Subject: [PATCH] SWIG bindings X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 03:53:28 -0000 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