python: Add properties to wrapped object.
authorJustus Winter <justus@g10code.com>
Fri, 10 Jun 2016 11:00:33 +0000 (13:00 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 16 Jun 2016 12:19:17 +0000 (14:19 +0200)
commit5464060baef2da8f5ea377118758e451c55e3787
tree126889232dc7a91188a9452971b992529dec361c
parent5492853d7b84b4e1d0b11b234e32252ba8d1608d
python: Add properties to wrapped object.

* lang/python/pyme/core.py (GpgmeWrapper.__repr__): Saner
representation.
(GpgmeWrapper.__str__): Construct a nicer human readable string.
(GpgmeWrapper._boolean_properties): New field.
(GpgmeWrapper.__wrap_boolean_property): New function.
(GpgmeWrapper.__getattr__): Wrap functions using properties.
(GpgmeWrapper.__setattr__): New method.  Likewise wrap functions.
(Context.signers): New property.
(Context.pinentry_mode): Likewise.
(Context._boolean_properties): List boolean properties.
(Context.__init__): Add keyword arguments for properties and apply
them.

Signed-off-by: Justus Winter <justus@g10code.com>
lang/python/pyme/core.py