1 Return-Path: <amthrax@drake.mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 9951C429E3F
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 Apr 2012 09:25:45 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id PzfAeCKQVwmj for <notmuch@notmuchmail.org>;
\r
16 Mon, 30 Apr 2012 09:25:44 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id BB4FD431FAF
\r
20 for <notmuch@notmuchmail.org>; Mon, 30 Apr 2012 09:25:44 -0700 (PDT)
\r
21 X-AuditID: 12074424-b7fae6d000000906-eb-4f9ebd08a482
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id A1.7E.02310.80DBE9F4; Mon, 30 Apr 2012 12:25:44 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q3UGPiYH029836;
\r
27 Mon, 30 Apr 2012 12:25:44 -0400
\r
28 Received: from drake.mit.edu
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3UGPgZ1005258
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Mon, 30 Apr 2012 12:25:43 -0400 (EDT)
\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
36 (envelope-from <amthrax@drake.mit.edu>)
\r
37 id 1SOtPy-0006HD-0T; Mon, 30 Apr 2012 12:25:42 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH v2 4/6] python: Update Python bindings for new
\r
41 notmuch_database_{open, create} signatures
\r
42 Date: Mon, 30 Apr 2012 12:25:36 -0400
\r
43 Message-Id: <1335803138-24024-5-git-send-email-amdragon@mit.edu>
\r
44 X-Mailer: git-send-email 1.7.9.1
\r
45 In-Reply-To: <1335803138-24024-1-git-send-email-amdragon@mit.edu>
\r
46 References: <1335651473-19652-1-git-send-email-amdragon@mit.edu>
\r
47 <1335803138-24024-1-git-send-email-amdragon@mit.edu>
\r
48 X-Brightmail-Tracker:
\r
49 H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixCmqrcuxd56/wYl34hbXb85kdmD0eLbq
\r
50 FnMAYxSXTUpqTmZZapG+XQJXxquZG5gKFotULFl9g7mB8TFfFyMnh4SAicS52c8YIWwxiQv3
\r
51 1rN1MXJxCAnsY5T4cOgmI4SzgVHi1uJD7BDOfSaJtVPPQZXNZ5TYcvMbG0g/m4CGxLb9y8Fm
\r
52 iQhIS+y8O5u1i5GDg1lATeJPlwpIWFggQ2LSmqlMIDaLgKrEp1UrWEFsXgEHiY19G5ggzlCQ
\r
53 eLbuOJjNKeAocevANxYQW0igXGLjhU+MExj5FzAyrGKUTcmt0s1NzMwpTk3WLU5OzMtLLdI1
\r
54 18vNLNFLTSndxAgKG3YXlR2MzYeUDjEKcDAq8fC+XDjPX4g1say4MvcQoyQHk5Ior+4eoBBf
\r
55 Un5KZUZicUZ8UWlOavEhRgkOZiUR3tKJQDnelMTKqtSifJiUNAeLkjivhtY7PyGB9MSS1OzU
\r
56 1ILUIpisDAeHkgSvPchQwaLU9NSKtMycEoQ0EwcnyHAeoOFgNbzFBYm5xZnpEPlTjIpS4rwM
\r
57 IAkBkERGaR5cLyyuXzGKA70izCsBUsUDTAlw3a+ABjMBDc43BxtckoiQkmpgPFzhNnHxYqOs
\r
58 aUvTVpoHLH7Oubz/d8WH+tblqe4Od6JFKkIs4u3t5uxWPZe9qmxGv73SZWuLL2ZV0SHbHn5u
\r
59 mBXvNa372ovn0x6s6C49NTM/nkdz5b3nj7a8qCpxmfZiijDLIotTLI1TLZ9FOCcw7mHlX7bF
\r
60 /nZCY4uNLOdpQ8nCfx91sxrPKbEUZyQaajEXFScCAOYG0czGAgAA
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Mon, 30 Apr 2012 16:25:45 -0000
\r
76 bindings/python/notmuch/database.py | 29 ++++++++++++++++-------------
\r
77 1 files changed, 16 insertions(+), 13 deletions(-)
\r
79 diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
\r
80 index 268e952..adc0a3f 100644
\r
81 --- a/bindings/python/notmuch/database.py
\r
82 +++ b/bindings/python/notmuch/database.py
\r
83 @@ -95,8 +95,8 @@ class Database(object):
\r
85 """notmuch_database_open"""
\r
86 _open = nmlib.notmuch_database_open
\r
87 - _open.argtypes = [c_char_p, c_uint]
\r
88 - _open.restype = NotmuchDatabaseP
\r
89 + _open.argtypes = [c_char_p, c_uint, POINTER(NotmuchDatabaseP)]
\r
90 + _open.restype = c_uint
\r
92 """notmuch_database_upgrade"""
\r
93 _upgrade = nmlib.notmuch_database_upgrade
\r
94 @@ -122,8 +122,8 @@ class Database(object):
\r
96 """notmuch_database_create"""
\r
97 _create = nmlib.notmuch_database_create
\r
98 - _create.argtypes = [c_char_p]
\r
99 - _create.restype = NotmuchDatabaseP
\r
100 + _create.argtypes = [c_char_p, POINTER(NotmuchDatabaseP)]
\r
101 + _create.restype = c_uint
\r
103 def __init__(self, path = None, create = False,
\r
104 mode = MODE.READ_ONLY):
\r
105 @@ -193,12 +193,13 @@ class Database(object):
\r
106 raise NotmuchError(message="Cannot create db, this Database() "
\r
107 "already has an open one.")
\r
109 - res = Database._create(_str(path), Database.MODE.READ_WRITE)
\r
110 + db = NotmuchDatabaseP()
\r
111 + status = Database._create(_str(path), Database.MODE.READ_WRITE, byref(db))
\r
114 - raise NotmuchError(
\r
115 - message="Could not create the specified database")
\r
117 + if status != STATUS.SUCCESS:
\r
118 + raise NotmuchError(status)
\r
122 def open(self, path, mode=0):
\r
123 """Opens an existing database
\r
124 @@ -212,11 +213,13 @@ class Database(object):
\r
125 :raises: Raises :exc:`NotmuchError` in case of any failure
\r
126 (possibly after printing an error message on stderr).
\r
128 - res = Database._open(_str(path), mode)
\r
129 + db = NotmuchDatabaseP()
\r
130 + status = Database._open(_str(path), mode, byref(db))
\r
133 - raise NotmuchError(message="Could not open the specified database")
\r
135 + if status != STATUS.SUCCESS:
\r
136 + raise NotmuchError(status)
\r
140 _close = nmlib.notmuch_database_close
\r
141 _close.argtypes = [NotmuchDatabaseP]
\r