From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 60FF86DE01E6 for ; Fri, 27 Apr 2018 12:20:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.011 X-Spam-Level: X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 OUKdro0_oCJ6 for ; Fri, 27 Apr 2018 12:20:50 -0700 (PDT) X-Greylist: delayed 502 seconds by postgrey-1.36 at arlo; Fri, 27 Apr 2018 12:20:49 PDT Received: from anarres.sindominio.net (anarres.sindominio.net [88.99.208.38]) by arlo.cworth.org (Postfix) with ESMTPS id C210D6DE01E4 for ; Fri, 27 Apr 2018 12:20:49 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by lesnaus.sindominio.net (Postfix) with ESMTP id 061F71E43CB2; Fri, 27 Apr 2018 21:12:23 +0200 (CEST) Received: from anarres.sindominio.net ([127.0.0.1]) by localhost (lesnaus.sindominio.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wduCMh7NEW0q; Fri, 27 Apr 2018 21:12:21 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lesnaus.sindominio.net (Postfix) with ESMTPSA id 40D2D1E43C9F; Fri, 27 Apr 2018 21:12:20 +0200 (CEST) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha512"; boundary="===============2829150174548129018==" MIME-Version: 1.0 Content-Disposition: inline From: meskio To: David Bremner , notmuch@notmuchmail.org References: <151194252933.14333.11265370454778979590@localhost> <20171129080308.21137-1-meskio@sindominio.net> <87y3lt8mfc.fsf@tethera.net> In-Reply-To: <87y3lt8mfc.fsf@tethera.net> Message-ID: <152485633339.1600.12264382495006409318@localhost> Subject: Re: [PATCH] python: add bindings for notmuch_message_get_propert(y/ies) Date: Fri, 27 Apr 2018 21:12:13 +0200 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Fri, 27 Apr 2018 19:20:51 -0000 --===============2829150174548129018== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Quoting David Bremner (2017-12-23 16:59:51) > Ruben Pollan writes: > > + > > + def get_properties(self, prop=3D"", exact=3DFalse): > = > As far as I understand, you also need to update docs/source/message.rst > so that your new methods are documented in the sphinx docs. > = > > + """ Get the properties for *message*, returning > > + notmuch_message_properties_t object which can be used to itera= te > > + over all properties. > = > This seeems to be wrong (or at last confusing) for the python bindings. > = > > + > > + :param prop: The name of the property to get. Otherwise it wil= l return > > + the full list of properties of the message. > > + :param exact: if True, require exact match with key. Otherwise > > + treat as prefix. > > + :returns: A dictionary with the property names and values {key= : value} > > + :raises: :exc:`NotInitializedError` if message has not been > > + initialized > > + """ > > + if not self._msg: > > + raise NotInitializedError() > > + > > + properties_dict =3D {} > > + properties =3D Message._get_properties(self._msg, prop, exact) > = > Now that the database.get_configs method is merged, I'd prefer to be cons= istent > with that, and define a generator that yields key/value pairs. It's easy > enough for someone to use a dictionary comprehension to get a dict from > that if they want it. Sorry to be making extra work for you. Good to me, I'm sending an update with all this fixed. Sorry for letting it hung for so long. -- = meskio | http://meskio.net/ -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D- My contact info: http://meskio.net/crypto.txt -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D- Nos vamos a Croatan. --===============2829150174548129018== MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Description: signature Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEs7M6f/ZpXzXMAQR+Urj1rJei2oYFAlrjdggACgkQUrj1rJei 2oY0lg/9H899SCbZQ++ZAPfWVqlu52i1ZdT4t1y+oaz0ILgeLGvylGM5es+j2uKX 7fJ+69YpkUiEvNDHvGgBZFr6tyGArACcq5fo/ZDNWMIQDR9rFQoFGcwnMyyDB0KF ASn5i0TyUDTe0/JwAV7m5EEergyMwqnHYVRTDyKwff2ajKbwM7UyUldRTO4nl/3y B3nZs3R3NFmNaeLPhJqJO+ED8gxKGcia/yS4vk1D7NlpJjUz1mz/+MkfcyKRxArx HZBs2HNMoYA7l4tc6b2bdh9GXiy7yEV5mWnept7WBC8W/ywxv8U5d9cZ4FbM4OBK jAWnh//tsba1OhA79XVskzw3RFUllR/E674iF7KK3IbM6CwpKX5ISc1SbaYz+h8W IUxboHYAR1tynu3OhLkZO58CKsT4qFZDM7vFszBVcgmaltaMDcv54aAfVysC0nll fxbyDPvBSCnprD6C4jGP4/3W04mLgt0esUpUPWk/52hUYLVpN7e4KyhH1POLLF4l BpG/n1MiLshCKoChjiW+OwSgkgSSkAvWQcCKa8TY7el0NdlCdwZob9/Sq7o2skGL QKm1JyqEKHCU4j77CmRARVvVsSucbthQJQJofcR5R0AYW5tLXjdXVn5CHnTXcl66 jVmSZ7CO87hQ+roB082pZqkct9fGWoYs3S0T0nCa691or9OhP8U= =WebJ -----END PGP SIGNATURE----- --===============2829150174548129018==--