[git] GPGME - branch, master, updated. gpgme-1.12.0-105-g772b5aa
by Ben McGinnes
cvs at cvs.gnupg.org
Mon Dec 10 23:58:19 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 772b5aae24a2a3a996f399024845de612192fc2f (commit)
from 2e7a14c9b369096775a035091c197f2d438142a0 (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 772b5aae24a2a3a996f399024845de612192fc2f
Author: Ben McGinnes <ben at adversary.org>
Date: Tue Dec 11 09:55:15 2018 +1100
python: hkp key importer
* Tweaked it slightly to avoid repetition of key searches when there
is only one search pattern to check (i.e. usually a single key ID or
fingerprint).
diff --git a/lang/python/examples/howto/import-keys-hkp.py b/lang/python/examples/howto/import-keys-hkp.py
index 1abd0fd..f5d9787 100755
--- a/lang/python/examples/howto/import-keys-hkp.py
+++ b/lang/python/examples/howto/import-keys-hkp.py
@@ -58,32 +58,37 @@ if pattern is not None:
if keyed is True:
try:
fob = server.search(pattern)
- except:
+ except Exception as e:
fob = None
if fob is not None:
keys.append(fob[0])
+ else:
+ pass
else:
pass
- else:
- pass
for logrus in pattern.split():
- try:
- key = server.search(hex(int(logrus, 16)))
- hexed = True
- except ValueError as ve:
- key = server.search(logrus)
- hexed = False
-
- if key is not None:
- keys.append(key[0])
- if hexed is True:
- try:
- fob = server.search(logrus)
- except:
- fob = None
- if fob is not None:
- keys.append(fob[0])
+ if logrus != pattern:
+ try:
+ key = server.search(hex(int(logrus, 16)))
+ hexed = True
+ except ValueError as ve:
+ key = server.search(logrus)
+ hexed = False
+
+ if key is not None:
+ keys.append(key[0])
+ if hexed is True:
+ try:
+ fob = server.search(logrus)
+ except Exception as e:
+ fob = None
+ if fob is not None:
+ keys.append(fob[0])
+ else:
+ pass
+ else:
+ pass
else:
pass
else:
-----------------------------------------------------------------------
Summary of changes:
lang/python/examples/howto/import-keys-hkp.py | 43 +++++++++++++++------------
1 file changed, 24 insertions(+), 19 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list