commit:     95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  1 00:54:52 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 03:01:31 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=95ec3b77
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.

---
 gkeys-gen/etc/gkeys-gen.conf |  5 +++++
 gkeys-gen/gkeygen/actions.py | 19 +++++++++++--------
 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):

Reply via email to