[PATCH 4/6] python: Update Python bindings for new notmuch_database_{open, create...
authorAustin Clements <amdragon@MIT.EDU>
Sat, 28 Apr 2012 22:17:51 +0000 (18:17 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:47 +0000 (09:46 -0800)
58/ba5e75a372173fca9c1663140bf848e5699f84 [new file with mode: 0644]

diff --git a/58/ba5e75a372173fca9c1663140bf848e5699f84 b/58/ba5e75a372173fca9c1663140bf848e5699f84
new file mode 100644 (file)
index 0000000..cfb4485
--- /dev/null
@@ -0,0 +1,143 @@
+Return-Path: <amthrax@drake.mit.edu>\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 0BF1A431FC3\r
+       for <notmuch@notmuchmail.org>; Sat, 28 Apr 2012 15:18:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 TfNt1WOmdbhq for <notmuch@notmuchmail.org>;\r
+       Sat, 28 Apr 2012 15:17:59 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+       [18.7.68.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5894D431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 28 Apr 2012 15:17:59 -0700 (PDT)\r
+X-AuditID: 12074424-b7fae6d000000906-dc-4f9c6c96815a\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 15.EE.02310.69C6C9F4; Sat, 28 Apr 2012 18:17:58 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q3SMHwwU007742; \r
+       Sat, 28 Apr 2012 18:17:58 -0400\r
+Received: from drake.mit.edu\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3SMHv2p008921\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 28 Apr 2012 18:17:58 -0400 (EDT)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1SOFxl-00058M-AY; Sat, 28 Apr 2012 18:17:57 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/6] python: Update Python bindings for new\r
+       notmuch_database_{open, create} signatures\r
+Date: Sat, 28 Apr 2012 18:17:51 -0400\r
+Message-Id: <1335651473-19652-5-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1335651473-19652-1-git-send-email-amdragon@mit.edu>\r
+References: <1335651473-19652-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixG6nrjstZ46/weVdNhbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXxquZG5gKFotULFl9g7mB8TFfFyMnh4SAicTG/k52CFtM4sK9\r
+       9WwgtpDAPkaJviWMEPYGRolja4DiXED2fSaJIzc3QTnzGSUWtkFUsQloSGzbvxzMFhGQlth5\r
+       dzZrFyMHB7OAmsSfLhUQU1ggVeL3ZCGQChYBVYlpjf/AdvEKOEi0vX/PDHGDgsSzdceZQGxO\r
+       AUeJ/5tPsEPc4CDRMW8C2wRG/gWMDKsYZVNyq3RzEzNzilOTdYuTE/PyUot0zfVyM0v0UlNK\r
+       NzGCA8ZFZQdj8yGlQ4wCHIxKPLy7sub4C7EmlhVX5h5ilORgUhLlZQEJ8SXlp1RmJBZnxBeV\r
+       5qQWH2KU4GBWEuHVFgfK8aYkVlalFuXDpKQ5WJTEeTW03vkJCaQnlqRmp6YWpBbBZGU4OJQk\r
+       eFuzgRoFi1LTUyvSMnNKENJMHJwgw3mAhu8BqeEtLkjMLc5Mh8ifYlSUEuddD5IQAElklObB\r
+       9cIi+hWjONArwrzTQap4gMkArvsV0GAmoMFMnrNABpckIqSkGhinbRbKr+tyKMvSqJtccD5d\r
+       c+v2f5OvV8oK/zNRmjH7/Mb2fEclj5y2jhtGLx6K/JvRHu+wsvCr1fJ/fG6ey8/5Pg9xe3/f\r
+       UfDSn32tiTkuF1YcmRJuF2dqrTi5+W18h0+3CNv+NpsP5zbJvpx48YYf9/mWPQ+6rd+Kueal\r
+       KmmuY7F+c0fz2CElluKMREMt5qLiRADXUaHBwwIAAA==\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: Sat, 28 Apr 2012 22:18:00 -0000\r
+\r
+---\r
+ bindings/python/notmuch/database.py |   29 ++++++++++++++++-------------\r
+ 1 files changed, 16 insertions(+), 13 deletions(-)\r
+\r
+diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py\r
+index 268e952..adc0a3f 100644\r
+--- a/bindings/python/notmuch/database.py\r
++++ b/bindings/python/notmuch/database.py\r
+@@ -95,8 +95,8 @@ class Database(object):\r
\r
+     """notmuch_database_open"""\r
+     _open = nmlib.notmuch_database_open\r
+-    _open.argtypes = [c_char_p, c_uint]\r
+-    _open.restype = NotmuchDatabaseP\r
++    _open.argtypes = [c_char_p, c_uint, POINTER(NotmuchDatabaseP)]\r
++    _open.restype = c_uint\r
\r
+     """notmuch_database_upgrade"""\r
+     _upgrade = nmlib.notmuch_database_upgrade\r
+@@ -122,8 +122,8 @@ class Database(object):\r
\r
+     """notmuch_database_create"""\r
+     _create = nmlib.notmuch_database_create\r
+-    _create.argtypes = [c_char_p]\r
+-    _create.restype = NotmuchDatabaseP\r
++    _create.argtypes = [c_char_p, POINTER(NotmuchDatabaseP)]\r
++    _create.restype = c_uint\r
\r
+     def __init__(self, path = None, create = False,\r
+                  mode = MODE.READ_ONLY):\r
+@@ -193,12 +193,13 @@ class Database(object):\r
+             raise NotmuchError(message="Cannot create db, this Database() "\r
+                                        "already has an open one.")\r
\r
+-        res = Database._create(_str(path), Database.MODE.READ_WRITE)\r
++        db = NotmuchDatabaseP()\r
++        status = Database._create(_str(path), Database.MODE.READ_WRITE, byref(db))\r
\r
+-        if not res:\r
+-            raise NotmuchError(\r
+-                message="Could not create the specified database")\r
+-        self._db = res\r
++        if status != STATUS.SUCCESS:\r
++            raise NotmuchError(status)\r
++        self._db = db\r
++        return status\r
\r
+     def open(self, path, mode=0):\r
+         """Opens an existing database\r
+@@ -212,11 +213,13 @@ class Database(object):\r
+         :raises: Raises :exc:`NotmuchError` in case of any failure\r
+                     (possibly after printing an error message on stderr).\r
+         """\r
+-        res = Database._open(_str(path), mode)\r
++        db = NotmuchDatabaseP()\r
++        status = Database._open(_str(path), mode, byref(db))\r
\r
+-        if not res:\r
+-            raise NotmuchError(message="Could not open the specified database")\r
+-        self._db = res\r
++        if status != STATUS.SUCCESS:\r
++            raise NotmuchError(status)\r
++        self._db = db\r
++        return status\r
\r
+     _close = nmlib.notmuch_database_close\r
+     _close.argtypes = [NotmuchDatabaseP]\r
+-- \r
+1.7.9.1\r
+\r