[git] GPGME - branch, master, updated. gpgme-1.12.0-45-g1b9d30d

by Ben McGinnes cvs at cvs.gnupg.org
Tue Nov 6 04:12:45 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  1b9d30db089e9de3ef859195ad58d2164a0231a0 (commit)
      from  bded8ebc59c7fdad2617f4c9232a58047656834c (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 1b9d30db089e9de3ef859195ad58d2164a0231a0
Author: Ben McGinnes <ben at adversary.org>
Date:   Tue Nov 6 14:11:01 2018 +1100

    python examples: protonmail hkp scripts
    
    * fixed a bug in the import try statement for both versions.

diff --git a/lang/python/examples/howto/pmkey-import-hkp-alt.py b/lang/python/examples/howto/pmkey-import-hkp-alt.py
index 673fe62..859de03 100755
--- a/lang/python/examples/howto/pmkey-import-hkp-alt.py
+++ b/lang/python/examples/howto/pmkey-import-hkp-alt.py
@@ -123,20 +123,17 @@ for keyterm in keyterms:
 
 for k in ksearch:
     print("Checking for key for: {0}".format(k))
-    try:
-        keys = server.search(k)
-        if isinstance(keys, list) is True:
-            for key in keys:
-                allkeys.append(key)
-                try:
-                    import_result = c.key_import(key.key_blob)
-                except Exception as e:
-                    import_result = c.key_import(key.key)
-        else:
-            paradox.append(keys)
-            import_result = None
-    except Exception as e:
-        import_result = None
+    import_result = None
+    keys = server.search(k)
+    if isinstance(keys, list) is True:
+        for key in keys:
+            allkeys.append(key)
+            try:
+                import_result = c.key_import(key.key_blob)
+            except Exception as e:
+                import_result = c.key_import(key.key)
+    else:
+        paradox.append(keys)
     results.append(import_result)
 
 for result in results:
diff --git a/lang/python/examples/howto/pmkey-import-hkp.py b/lang/python/examples/howto/pmkey-import-hkp.py
index f7f6266..3b9345f 100755
--- a/lang/python/examples/howto/pmkey-import-hkp.py
+++ b/lang/python/examples/howto/pmkey-import-hkp.py
@@ -86,20 +86,17 @@ for keyterm in keyterms:
 
 for k in ksearch:
     print("Checking for key for: {0}".format(k))
-    try:
-        keys = server.search(k)
-        if isinstance(keys, list) is True:
-            for key in keys:
-                allkeys.append(key)
-                try:
-                    import_result = c.key_import(key.key_blob)
-                except Exception as e:
-                    import_result = c.key_import(key.key)
-        else:
-            paradox.append(keys)
-            import_result = None
-    except Exception as e:
-        import_result = None
+    import_result = None
+    keys = server.search(k)
+    if isinstance(keys, list) is True:
+        for key in keys:
+            allkeys.append(key)
+            try:
+                import_result = c.key_import(key.key_blob)
+            except Exception as e:
+                import_result = c.key_import(key.key)
+    else:
+        paradox.append(keys)
     results.append(import_result)
 
 for result in results:

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

Summary of changes:
 lang/python/examples/howto/pmkey-import-hkp-alt.py | 25 ++++++++++------------
 lang/python/examples/howto/pmkey-import-hkp.py     | 25 ++++++++++------------
 2 files changed, 22 insertions(+), 28 deletions(-)


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




More information about the Gnupg-commits mailing list