aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/gpg/core.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-02-15 10:28:02 +0000
committerJustus Winter <[email protected]>2017-02-15 15:36:29 +0000
commit25f0435a0022a70af77660d72d33f17bec2d4e51 (patch)
tree02099094650f50e5c71a34ba77e66f7422c6bfd4 /lang/python/gpg/core.py
parentcore: Fix error types. (diff)
downloadgpgme-25f0435a0022a70af77660d72d33f17bec2d4e51.tar.gz
gpgme-25f0435a0022a70af77660d72d33f17bec2d4e51.zip
python: Update lists of functions returning gpgme_error_t.
* lang/python/gpg/core.py (Context._errorcheck): Add instructions how to update the list. Update list. (Data._errorcheck): Likewise. (Context.set_engine_info): Simplify. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/gpg/core.py')
-rw-r--r--lang/python/gpg/core.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/lang/python/gpg/core.py b/lang/python/gpg/core.py
index 18a7e3a5..3a635160 100644
--- a/lang/python/gpg/core.py
+++ b/lang/python/gpg/core.py
@@ -628,22 +628,27 @@ class Context(GpgmeWrapper):
def _errorcheck(self, name):
"""This function should list all functions returning gpgme_error_t"""
+ # The list of functions is created using:
+ #
+ # $ grep '^gpgme_error_t ' obj/lang/python/python3.5-gpg/gpgme.h \
+ # | grep -v _op_ | awk "/\(gpgme_ctx/ { printf (\"'%s',\\n\", \$2) } "
return ((name.startswith('gpgme_op_')
and not name.endswith('_result'))
or name in {
+ 'gpgme_new',
'gpgme_set_ctx_flag',
'gpgme_set_protocol',
'gpgme_set_sub_protocol',
'gpgme_set_keylist_mode',
'gpgme_set_pinentry_mode',
'gpgme_set_locale',
- 'gpgme_set_engine_info',
+ 'gpgme_ctx_set_engine_info',
'gpgme_signers_add',
- 'gpgme_get_sig_key',
'gpgme_sig_notation_add',
+ 'gpgme_set_sender',
'gpgme_cancel',
'gpgme_cancel_async',
- 'gpgme_cancel_get_key',
+ 'gpgme_get_key',
})
_boolean_properties = {'armor', 'textmode', 'offline'}
@@ -850,8 +855,7 @@ class Context(GpgmeWrapper):
home_dir -- configuration directory (unchanged if None)
"""
- errorcheck(gpgme.gpgme_ctx_set_engine_info(
- self.wrapped, proto, file_name, home_dir))
+ self.ctx_set_engine_info(proto, file_name, home_dir)
def wait(self, hang):
"""Wait for asynchronous call to finish. Wait forever if hang is True.
@@ -905,11 +909,19 @@ class Data(GpgmeWrapper):
def _errorcheck(self, name):
"""This function should list all functions returning gpgme_error_t"""
+ # This list is compiled using
+ #
+ # $ grep -v '^gpgme_error_t ' obj/lang/python/python3.5-gpg/gpgme.h \
+ # | awk "/\(gpgme_data_t/ { printf (\"'%s',\\n\", \$2) } " | sed "s/'\\*/'/"
return name not in {
+ 'gpgme_data_read',
+ 'gpgme_data_write',
+ 'gpgme_data_seek',
+ 'gpgme_data_release',
'gpgme_data_release_and_get_mem',
'gpgme_data_get_encoding',
- 'gpgme_data_seek',
'gpgme_data_get_file_name',
+ 'gpgme_data_identify',
}
def __init__(self, string=None, file=None, offset=None,