[git] GPGME - branch, master, updated. gpgme-1.12.0-110-g4308d17

by Ben McGinnes cvs at cvs.gnupg.org
Thu Dec 13 19:19:49 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  4308d172816f3172454fac1dc0771014056764a1 (commit)
      from  3849b60e22432ef33f0d1d39b88e07922ad7779e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4308d172816f3172454fac1dc0771014056764a1
Author: Ben McGinnes <ben at adversary.org>
Date:   Fri Dec 14 05:17:10 2018 +1100

    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.

diff --git a/lang/python/examples/howto/pmkey-import-alt.py b/lang/python/examples/howto/pmkey-import-alt.py
index def1025..1a68dc5 100755
--- a/lang/python/examples/howto/pmkey-import-alt.py
+++ b/lang/python/examples/howto/pmkey-import-alt.py
@@ -110,6 +110,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}
 
@@ -125,7 +131,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)
diff --git a/lang/python/examples/howto/pmkey-import-hkp-alt.py b/lang/python/examples/howto/pmkey-import-hkp-alt.py
index 859de03..9d6bb5e 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)
diff --git a/lang/python/examples/howto/pmkey-import-hkp.py b/lang/python/examples/howto/pmkey-import-hkp.py
index 3b9345f..1a11b4a 100755
--- a/lang/python/examples/howto/pmkey-import-hkp.py
+++ b/lang/python/examples/howto/pmkey-import-hkp.py
@@ -110,10 +110,16 @@ 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}
 
-With UIDs wholely or partially matching the following string:
+With UIDs wholely or partially matching the following string(s):
 
         {1}
 
@@ -125,7 +131,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)
diff --git a/lang/python/examples/howto/pmkey-import.py b/lang/python/examples/howto/pmkey-import.py
index 10d733d..1f6fd29 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)

-----------------------------------------------------------------------

Summary of changes:
 lang/python/examples/howto/pmkey-import-alt.py     |  8 +++++++-
 lang/python/examples/howto/pmkey-import-hkp-alt.py |  8 +++++++-
 lang/python/examples/howto/pmkey-import-hkp.py     | 10 ++++++++--
 lang/python/examples/howto/pmkey-import.py         |  8 +++++++-
 4 files changed, 29 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list