aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2014-12-31 16:54:52 -0800
committerBrian Dolbec <dolsen@gentoo.org>2014-12-31 19:01:31 -0800
commit95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa (patch)
tree7f135a992a07c5c2d4e0290ec21f38b864132a12 /gkeys-gen
parentgekys-gen/setup.py: Update for recent changes (diff)
downloadgentoo-keys-95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa.tar.gz
gentoo-keys-95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa.tar.bz2
gentoo-keys-95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa.zip
gkeygen/actions.py: Message updates to show spec file and url being used
Change a logger.error message to a logger.debug as the error info printed was too generic to be useful. Tweak the input messages for better display. etc/gkeys-gen.conf: Add spec-homepage section In order to make the creator fully configurable. We needed to make the homepage for the spec configurable too.
Diffstat (limited to 'gkeys-gen')
-rw-r--r--gkeys-gen/etc/gkeys-gen.conf5
-rw-r--r--gkeys-gen/gkeygen/actions.py19
2 files changed, 16 insertions, 8 deletions
diff --git a/gkeys-gen/etc/gkeys-gen.conf b/gkeys-gen/etc/gkeys-gen.conf
index d67f10a..423e12a 100644
--- a/gkeys-gen/etc/gkeys-gen.conf
+++ b/gkeys-gen/etc/gkeys-gen.conf
@@ -19,6 +19,11 @@ default-spec = glep-63
glep-63 = https://api.gentoo.org/gentoo-keys/specs/glep63.spec
+[spec-homepage]
+
+glep-63 = https://wiki.gentoo.org/wiki/GLEP:63
+
+
[gpg-configs]
glep-63 = %(user-dir)s/glep63-gpg-conf.skel
diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index 8ddf624..62aaf05 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -110,7 +110,7 @@ class Actions(object):
try:
result = ctx.genkey(key_params)
except gpgme.GpgmeError as e:
- self.logger.error("MAIN: _action_genkey: GpgmeError: %s" % str(e))
+ self.logger.debug("MAIN: _action_genkey: GpgmeError: %s" % str(e))
self.logger.debug("MAIN: _action_genkey: Aborting... Failed to get a password.")
messages.extend(['', "Aborting... Failed to get a password."])
return (False, messages)
@@ -120,18 +120,21 @@ class Actions(object):
self.output(["Your new GLEP 63 based OpenPGP key has been created in %s" % gpghome_full_path])
self.output([GPG_INFO_STRING % (key.uids[0].name, key.uids[0].email,
key.subkeys[0].fpr)])
- self.output(["In order to use your new key, place the new gpghome to your ~/.gnupg folder by running the following command:\n"
- " mv %s ~/.gnupg\n"
- "Important: If you have another old key in ~/.gnupg please make sure you backup it up first.\n\n"
- "Please read the FAQ for post-generation steps that are available in: \n"
- "https://wiki.gentoo.org/wiki/Project:Gentoo-keys/Generating_GLEP_63_based_OpenPGP_keys\n" % gpghome_full_path])
+ self.output(["In order to use your new key, place the new gpghome to your ~/.gnupg folder by running the following command:",
+ " mv %s ~/.gnupg" % gpghome_full_path,
+ "Important: If you have another old key in ~/.gnupg please make sure you backup it up first.\n",
+ "Please read the FAQ for post-generation steps that are available in:",
+ "https://wiki.gentoo.org/wiki/Project:Gentoo-keys/Generating_GLEP_63_based_OpenPGP_keys"])
return (True, messages)
def get_input(self, args):
'''Interactive user input'''
- self.output(["\nGPG key creator based on GLEP 63\n"
- "(https://wiki.gentoo.org/wiki/GLEP:63)\n"])
+ self.output(['', "GPG key creator",
+ " Spec file..: %s" % args.spec,
+ " Homepage...: %s"
+ % self.config.get_key('spec-homepage', args.spec),
+ ])
name = py_input("Give your Full Name: ")
email = py_input("Give your Email: ")
while not re.match(r'[\w.-]+@[\w.-]+', email):