[PATCH] python: add bindings for notmuch_message_get_propert(y/ies)

meskio meskio at sindominio.net
Fri Apr 27 12:12:13 PDT 2018


Quoting David Bremner (2017-12-23 16:59:51)
> Ruben Pollan <meskio at sindominio.net> writes:
> > +
> > +    def get_properties(self, prop="", exact=False):
> 
> 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 iterate
> > +        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 will 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 = {}
> > +        properties = Message._get_properties(self._msg, prop, exact)
> 
> Now that the database.get_configs method is merged, I'd prefer to be consistent
> 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/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 My contact info: http://meskio.net/crypto.txt
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Nos vamos a Croatan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20180427/1b5fb07d/attachment.sig>


More information about the notmuch mailing list