1 |
commit: 95ec3b7768dec9e02e1a7d1069d9fa5d52537dfa |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 1 00:54:52 2015 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 1 03:01:31 2015 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=95ec3b77 |
7 |
|
8 |
gkeygen/actions.py: Message updates to show spec file and url being used |
9 |
|
10 |
Change a logger.error message to a logger.debug as the error info printed was too generic to be useful. |
11 |
Tweak the input messages for better display. |
12 |
etc/gkeys-gen.conf: Add spec-homepage section |
13 |
|
14 |
In order to make the creator fully configurable. |
15 |
We needed to make the homepage for the spec configurable too. |
16 |
|
17 |
--- |
18 |
gkeys-gen/etc/gkeys-gen.conf | 5 +++++ |
19 |
gkeys-gen/gkeygen/actions.py | 19 +++++++++++-------- |
20 |
2 files changed, 16 insertions(+), 8 deletions(-) |
21 |
|
22 |
diff --git a/gkeys-gen/etc/gkeys-gen.conf b/gkeys-gen/etc/gkeys-gen.conf |
23 |
index d67f10a..423e12a 100644 |
24 |
--- a/gkeys-gen/etc/gkeys-gen.conf |
25 |
+++ b/gkeys-gen/etc/gkeys-gen.conf |
26 |
@@ -19,6 +19,11 @@ default-spec = glep-63 |
27 |
glep-63 = https://api.gentoo.org/gentoo-keys/specs/glep63.spec |
28 |
|
29 |
|
30 |
+[spec-homepage] |
31 |
+ |
32 |
+glep-63 = https://wiki.gentoo.org/wiki/GLEP:63 |
33 |
+ |
34 |
+ |
35 |
[gpg-configs] |
36 |
|
37 |
glep-63 = %(user-dir)s/glep63-gpg-conf.skel |
38 |
|
39 |
diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py |
40 |
index 8ddf624..62aaf05 100644 |
41 |
--- a/gkeys-gen/gkeygen/actions.py |
42 |
+++ b/gkeys-gen/gkeygen/actions.py |
43 |
@@ -110,7 +110,7 @@ class Actions(object): |
44 |
try: |
45 |
result = ctx.genkey(key_params) |
46 |
except gpgme.GpgmeError as e: |
47 |
- self.logger.error("MAIN: _action_genkey: GpgmeError: %s" % str(e)) |
48 |
+ self.logger.debug("MAIN: _action_genkey: GpgmeError: %s" % str(e)) |
49 |
self.logger.debug("MAIN: _action_genkey: Aborting... Failed to get a password.") |
50 |
messages.extend(['', "Aborting... Failed to get a password."]) |
51 |
return (False, messages) |
52 |
@@ -120,18 +120,21 @@ class Actions(object): |
53 |
self.output(["Your new GLEP 63 based OpenPGP key has been created in %s" % gpghome_full_path]) |
54 |
self.output([GPG_INFO_STRING % (key.uids[0].name, key.uids[0].email, |
55 |
key.subkeys[0].fpr)]) |
56 |
- self.output(["In order to use your new key, place the new gpghome to your ~/.gnupg folder by running the following command:\n" |
57 |
- " mv %s ~/.gnupg\n" |
58 |
- "Important: If you have another old key in ~/.gnupg please make sure you backup it up first.\n\n" |
59 |
- "Please read the FAQ for post-generation steps that are available in: \n" |
60 |
- "https://wiki.gentoo.org/wiki/Project:Gentoo-keys/Generating_GLEP_63_based_OpenPGP_keys\n" % gpghome_full_path]) |
61 |
+ self.output(["In order to use your new key, place the new gpghome to your ~/.gnupg folder by running the following command:", |
62 |
+ " mv %s ~/.gnupg" % gpghome_full_path, |
63 |
+ "Important: If you have another old key in ~/.gnupg please make sure you backup it up first.\n", |
64 |
+ "Please read the FAQ for post-generation steps that are available in:", |
65 |
+ "https://wiki.gentoo.org/wiki/Project:Gentoo-keys/Generating_GLEP_63_based_OpenPGP_keys"]) |
66 |
return (True, messages) |
67 |
|
68 |
|
69 |
def get_input(self, args): |
70 |
'''Interactive user input''' |
71 |
- self.output(["\nGPG key creator based on GLEP 63\n" |
72 |
- "(https://wiki.gentoo.org/wiki/GLEP:63)\n"]) |
73 |
+ self.output(['', "GPG key creator", |
74 |
+ " Spec file..: %s" % args.spec, |
75 |
+ " Homepage...: %s" |
76 |
+ % self.config.get_key('spec-homepage', args.spec), |
77 |
+ ]) |
78 |
name = py_input("Give your Full Name: ") |
79 |
email = py_input("Give your Email: ") |
80 |
while not re.match(r'[\w.-]+@[\w.-]+', email): |