<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gpgme/lang/python/pyme, branch justus/idiomatic-py-0</title>
<subtitle>GnuPG Made Easy.</subtitle>
<id>http://git.bktus.com/gpgfrontend/gpgme/atom?h=justus%2Fidiomatic-py-0</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/gpgme/atom?h=justus%2Fidiomatic-py-0'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/'/>
<updated>2016-07-08T16:05:12Z</updated>
<entry>
<title>python: idiomatic interface prototype</title>
<updated>2016-07-08T16:05:12Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-08T16:58:57Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=d6408ce471c294c3e6f901d183b87d521b9bcc56'/>
<id>urn:sha1:d6408ce471c294c3e6f901d183b87d521b9bcc56</id>
<content type='text'>
Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Improve autmatically generated docstrings.</title>
<updated>2016-06-16T12:19:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-14T11:28:37Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=8997d88bf97d1784706becbf8e9dc74e4656e311'/>
<id>urn:sha1:8997d88bf97d1784706becbf8e9dc74e4656e311</id>
<content type='text'>
* lang/python/gpgme.i: Add comment.
* lang/python/pyme/core.py (__getattr__): Rewrite automatically
generated doctrings for the wrapper methods.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Make result objects more robust.</title>
<updated>2016-06-16T12:19:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-14T15:33:12Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=a324d0cffe93cab955698c2c065b2f2227e379e4'/>
<id>urn:sha1:a324d0cffe93cab955698c2c065b2f2227e379e4</id>
<content type='text'>
Results returned by the GPGME are fragile, i.e. they are only valid
until the next operation is performed in the context.

We cannot arbitrarily constrain the lifetime of Python objects, we
therefore create deep copies of the results.

* lang/python/gpgme.i (gpgme_tofu_info_t): Turn these into a list.
(gpgme_*_result_t): Create deep copies of these objects.
* lang/python/helpers.c (pygpgme_wrap_fragile_result): New function.
* lang/python/helpers.h (pygpgme_wrap_fragile_result): New prototype.
* lang/python/pyme/results.py: New file.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Simplify wrapping glue.</title>
<updated>2016-06-16T12:19:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-14T10:37:26Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=6641c7814b30e3e8f18105b2636545cc1bd07552'/>
<id>urn:sha1:6641c7814b30e3e8f18105b2636545cc1bd07552</id>
<content type='text'>
* lang/python/pyme/core.py: Rename '_getctype' to '_ctype' and turn it
  into a string.  Likewise rename '_getnameprepend' to '_cprefix'.
* lang/python/helpers.c: Adapt accordingly.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Rework callbacks.</title>
<updated>2016-06-16T12:19:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-13T17:16:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=f3618bc615e3eff1f52fb5849cbf0f0b95515a61'/>
<id>urn:sha1:f3618bc615e3eff1f52fb5849cbf0f0b95515a61</id>
<content type='text'>
Simplify how the lifetime of callback arguments is managed.

* lang/python/gpgme.i (gpgme_edit_cb_t): Check arguments.
(PyObject_p_p, void_p_p): Drop rather dangerous interface.
(pygpgme_unwrap_gpgme_ctx_t): New function.
* lang/python/helpers.c (pygpgme_clear_generic_cb): Drop dangerous
function.
(pyPassphraseCb): Assert contract.
(pygpgme_set_passphrase_cb): Use Python's calling convention so that
we can raise exceptions.  Hand in 'self', get the wrapped object, and
simply store the hook data as attribute of the wrapper object.
(pyProgressCb, pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
* lang/python/helpers.h (pygpgme_clear_generic_cb): Drop prototype.
(pygpgme_set_passphrase_cb): Update prototype.
(pygpgme_set_progress_cb): Likewise.
(pygpgme_set_status_cb): Likewise.
(pygpgme_data_new_from_cbs): Likewise.
(pygpgme_unwrap_gpgme_ctx_t): New prottotype.
* lang/python/pyme/core.py (Context, Data): Update callsites.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Add properties to wrapped object.</title>
<updated>2016-06-16T12:19:17Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-10T11:00:33Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=5464060baef2da8f5ea377118758e451c55e3787'/>
<id>urn:sha1:5464060baef2da8f5ea377118758e451c55e3787</id>
<content type='text'>
* 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 &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Improve the documentation.</title>
<updated>2016-06-16T12:07:41Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-06T12:08:59Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=5492853d7b84b4e1d0b11b234e32252ba8d1608d'/>
<id>urn:sha1:5492853d7b84b4e1d0b11b234e32252ba8d1608d</id>
<content type='text'>
* lang/python/Makefile.am: Copy the README file.
* lang/python/README: Rename, convert to org, and update.
* lang/python/pyme/__init__.py: Move license out of the docstring,
update docstring.
* lang/python/pyme/core.py: Add and update docstrings.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Get version information from the build system.</title>
<updated>2016-06-16T12:07:41Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-09T10:38:50Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=7eef399d89d4c3877cb795ed5ba45ecb241e67be'/>
<id>urn:sha1:7eef399d89d4c3877cb795ed5ba45ecb241e67be</id>
<content type='text'>
* configure.ac: Generate 'setup.py' and 'version.py'.
* lang/python/Makefile.am: Use generated setup script.
* lang/python/pyme/version.py: Turn it into a template, and get
version information from the build system.  Also drop some variables.
* lang/python/setup.py: Likewise.  This way we can avoid importing the
version module, which is frowned upon and actually caused a problem.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Implement the context manager protocol.</title>
<updated>2016-06-08T11:44:09Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-07T17:31:10Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=e3c5913a33edcbd7329b8d154c669f95ce782038'/>
<id>urn:sha1:e3c5913a33edcbd7329b8d154c669f95ce782038</id>
<content type='text'>
* lang/python/pyme/core.py (Context.__del__): Make function
idemptotent.
(Context.{__enter__,__exit__}): Implement the context manager
protocol.
(Data.__del__): Make function idemptotent, drop debug print.
(Data.{__enter__,__exit__}): Implement the context manager
protocol.
* lang/python/tests/t-idiomatic.py: Demonstrate this.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
<entry>
<title>python: Initialize GPGME for the user.</title>
<updated>2016-06-06T12:16:04Z</updated>
<author>
<name>Justus Winter</name>
<email>justus@g10code.com</email>
</author>
<published>2016-06-02T13:18:40Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/gpgme/commit/?id=ae06f7c2fe0e49baeab5a827dc38ba8c57a6404c'/>
<id>urn:sha1:ae06f7c2fe0e49baeab5a827dc38ba8c57a6404c</id>
<content type='text'>
* lang/python/pyme/core.py: Call 'check_version' and explain why.
* lang/python/tests/support.py (init_gpgme): Drop call here.

Signed-off-by: Justus Winter &lt;justus@g10code.com&gt;
</content>
</entry>
</feed>
