diff options
| author | Ben McGinnes <[email protected]> | 2018-12-13 18:17:10 +0000 | 
|---|---|---|
| committer | Ben McGinnes <[email protected]> | 2018-12-13 18:17:10 +0000 | 
| commit | 4308d172816f3172454fac1dc0771014056764a1 (patch) | |
| tree | f585387752db56676b0f6252f57f7bf11a973912 /lang/python/examples/howto/pmkey-import.py | |
| parent | python: new example script (diff) | |
| download | gpgme-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.py')
| -rwxr-xr-x | lang/python/examples/howto/pmkey-import.py | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/examples/howto/pmkey-import.py b/lang/python/examples/howto/pmkey-import.py index 10d733db..1f6fd297 100755 --- a/lang/python/examples/howto/pmkey-import.py +++ b/lang/python/examples/howto/pmkey-import.py @@ -94,6 +94,12 @@ for k in ksearch:          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} @@ -109,7 +115,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)  | 
