From: Patrick Totzke Date: Sun, 13 Mar 2016 12:03:20 +0000 (+0000) Subject: Re: [PATCH] use notmuch_database_open_verbose X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d21ca430b51edc13dfa57ae87eaae6686b500792;p=notmuch-archives.git Re: [PATCH] use notmuch_database_open_verbose --- diff --git a/b6/b40e43c0cabd1a114a78be5c5b372cfe3aacc2 b/b6/b40e43c0cabd1a114a78be5c5b372cfe3aacc2 new file mode 100644 index 000000000..d43e82f08 --- /dev/null +++ b/b6/b40e43c0cabd1a114a78be5c5b372cfe3aacc2 @@ -0,0 +1,160 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id F0B9E6DE1873 + for ; Sun, 13 Mar 2016 05:03:25 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -1.01 +X-Spam-Level: +X-Spam-Status: No, score=-1.01 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id nZeFJloXLEOD for ; + Sun, 13 Mar 2016 05:03:23 -0700 (PDT) +Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com + [209.85.217.176]) + by arlo.cworth.org (Postfix) with ESMTPS id 047366DE186A + for ; Sun, 13 Mar 2016 05:03:23 -0700 (PDT) +Received: by mail-lb0-f176.google.com with SMTP id x1so206873965lbj.3 + for ; Sun, 13 Mar 2016 05:03:22 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=mime-version:reply-to:in-reply-to:references:date:message-id + :subject:from:to:cc; + bh=YCM6UPksz511AsnAT9ete9v5QFCnScKTahzFSsy6KRY=; + b=ht/Tx4uJK6C4JCbUdXUXqo9lT8544AegBT3dCTqZbwOlwd60xZwiCcKM8UmtMH1n2g + z6AM7BSaM4RpIRvdGjuDGLQllEA3x+2EMqX6s2qFK19D8itl5dce/TwFHAZtQvKCW/2y + n4Iqya4BK5n9OKzefraWeyPPA6hTSTWO+Bs8hWP00C+myIU9bgImTI+PYSTzJEtQalh5 + WG78e9GDVJrsCJ09YF31OltEKwBvi1Dew9dA0R4OelN5g6t5GJgFege2MnzdVD05YZXf + JKwZa/FdZbWjYIo1jrfUpy4Yig34ws5d/+DtB/B3VeinM9zHQn7f61ytOmsgm8qAx5Fm + 312g== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:mime-version:reply-to:in-reply-to:references + :date:message-id:subject:from:to:cc; + bh=YCM6UPksz511AsnAT9ete9v5QFCnScKTahzFSsy6KRY=; + b=kZ1H9blGdTLudBQnkIwAlhSxXYJm0rinLhLTzv5KTvOWtzilbrxt35IjE7pOGeOCRw + AvTfNi8mCk/nZID981BMXMe9R4NfmWxBc/1A2N6YJnDWj77IegnavRlNaeCe66iFy1EH + YLFX4AOy3kbEJWl/BDDuj93N7vZA/tFm/AM06gKdxVfKL0FDRLhVnrlp5xOqcVc1R9X6 + hDgkIpuKumfC2GHzmpqOfcwtUlU7gyqC2qZMJH79cz1YJxPgMq+mVZK0Rq/bIiAx17bP + nqCNuWH57MOgFxsE4fiFdyK895yvUTlUvkBrnjAJq6KoVdzdtQFIOAXcuddlh3rKJLKC + F3jQ== +X-Gm-Message-State: AD7BkJJVg/+RENGuxmIszV18oqU4+HS5GZj9vD6lUTklsTBKp4UxcGOadEp8WHssCnjdQ72n9Z6SBN7IlAvmcQ== +MIME-Version: 1.0 +X-Received: by 10.25.169.82 with SMTP id s79mr6432345lfe.47.1457870600694; + Sun, 13 Mar 2016 05:03:20 -0700 (PDT) +Received: by 10.25.87.145 with HTTP; Sun, 13 Mar 2016 05:03:20 -0700 (PDT) +Reply-To: patricktotzke@gmail.com +In-Reply-To: <87oaaj64gh.fsf@zancas.localnet> +References: <1457795857-12410-1-git-send-email-patricktotzke@gmail.com> + <87r3ff64sa.fsf@zancas.localnet> <87oaaj64gh.fsf@zancas.localnet> +Date: Sun, 13 Mar 2016 12:03:20 +0000 +Message-ID: + +Subject: Re: [PATCH] use notmuch_database_open_verbose +From: Patrick Totzke +To: David Bremner +Cc: "notmuch@notmuchmail.org" +Content-Type: multipart/alternative; boundary=001a114106d848727c052decf368 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Sun, 13 Mar 2016 12:03:26 -0000 + +--001a114106d848727c052decf368 +Content-Type: text/plain; charset=UTF-8 + +As far as I understand the bindings, the returned message is not needed +because the return +value of `Database._open` (line 212) contains information about the type of +error that occurred. +This is passed on two lines below if the open-call was unsuccessful. + +The docstrings for this method are not ideal (the mentioned "status" +parameter is actually called "mode") but in terms of functionality it seems +ok. + +On 12 March 2016 at 16:33, David Bremner wrote: + +> David Bremner writes: +> +> >> - """notmuch_database_open""" +> >> - _open = nmlib.notmuch_database_open +> >> + """notmuch_database_open_verbose""" +> >> + _open = nmlib.notmuch_database_open_verbose +> >> _open.argtypes = [c_char_p, c_uint, POINTER(NotmuchDatabaseP)] +> >> _open.restype = c_uint +> > +> > I expect you probably want to add the new binding, rather than replacing +> > the old one. Otherwise updating the bindings will break all bindings +> > using scripts. +> +> Oh silly me. That's not actually exposed to the python API, so that's +> fine. On the other hand, don't you want to update the argument types and +> do something useful (throw an exception?) with the returned message? As +> it stands you lose information. +> +> d +> + +--001a114106d848727c052decf368 +Content-Type: text/html; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + +
As far as I understand the bindings, the re= +turned message is not needed because the return
value of `Database= +._open` (line 212) contains information about the type of error that occurr= +ed.
This is passed on two lines below if the open-call was unsucce= +ssful.

The + docstrings for this method are not ideal (the mentioned "status"= +=20 +parameter is actually called "mode") but in terms of functionalit= +y it=20 +seems ok.

On= + 12 March 2016 at 16:33, David Bremner <david@tethera.net> w= +rote:
David Bremner <= +david@tethera.net> writes:
+
+>> -=C2=A0 =C2=A0 """notmuch_database_open""= +"
+>> -=C2=A0 =C2=A0 _open =3D nmlib.notmuch_database_open
+>> +=C2=A0 =C2=A0 """notmuch_database_open_verbose&quo= +t;""
+>> +=C2=A0 =C2=A0 _open =3D nmlib.notmuch_database_open_verbose
+>>=C2=A0 =C2=A0 =C2=A0 _open.argtypes =3D [c_char_p, c_uint, POINTER(= +NotmuchDatabaseP)]
+>>=C2=A0 =C2=A0 =C2=A0 _open.restype =3D c_uint
+>
+> I expect you probably want to add the new binding, rather than replaci= +ng
+> the old one. Otherwise updating the bindings will break all bindings +> using scripts.
+
+
Oh silly me. That's not actually exposed to the python API, so t= +hat's
+fine. On the other hand, don't you want to update the argument types an= +d
+do something useful (throw an exception?) with the returned message?=C2=A0 = +As
+it stands you lose information.
+
+d
+

+ +--001a114106d848727c052decf368--