aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/pmkey-import-hkp-alt.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-12-13 18:17:10 +0000
committerBen McGinnes <[email protected]>2018-12-13 18:17:10 +0000
commit4308d172816f3172454fac1dc0771014056764a1 (patch)
treef585387752db56676b0f6252f57f7bf11a973912 /lang/python/examples/howto/pmkey-import-hkp-alt.py
parentpython: new example script (diff)
downloadgpgme-4308d172816f3172454fac1dc0771014056764a1.tar.gz
gpgme-4308d172816f3172454fac1dc0771014056764a1.zip
python: examples bugfix
* Fixed a bug in the ProtonMail importers (pmkey-*.py) where multiple keys found for a username would always result in the last email address checked being returned in the printed output for all located keys.
Diffstat (limited to 'lang/python/examples/howto/pmkey-import-hkp-alt.py')
-rwxr-xr-xlang/python/examples/howto/pmkey-import-hkp-alt.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/examples/howto/pmkey-import-hkp-alt.py b/lang/python/examples/howto/pmkey-import-hkp-alt.py
index 859de03b..9d6bb5ef 100755
--- a/lang/python/examples/howto/pmkey-import-hkp-alt.py
+++ b/lang/python/examples/howto/pmkey-import-hkp-alt.py
@@ -147,6 +147,12 @@ for result in results:
new_uids = result.new_user_ids
new_scrt = result.secret_imported
nochange = result.unchanged
+
+ def knom():
+ for ki in result.imports:
+ for ku in c.get_key(ki.fpr).uids:
+ return ku.uid
+
print("""
The total number of keys considered for import was: {0}
@@ -162,7 +168,7 @@ Number of new secret keys: {6}
Number of unchanged keys: {7}
The key IDs for all considered keys were:
-""".format(num_keys, k, new_revs, new_sigs, new_subs, new_uids, new_scrt,
+""".format(num_keys, knom(), new_revs, new_sigs, new_subs, new_uids, new_scrt,
nochange))
for i in range(num_keys):
print(result.imports[i].fpr)