public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2014-12-26  5:02 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2014-12-26  5:02 UTC (permalink / raw
  To: gentoo-commits

commit:     1d6676d1e2602a2232a2a996141ec3a6f1133038
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 26 05:01:15 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Dec 26 05:01:15 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=1d6676d1

gkeygen/actions.py: tweak py3 version check (more readable)

---
 gkeys-gen/gkeygen/actions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index 22b3089..e33ebb8 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -15,7 +15,7 @@ import re
 import shutil
 import sys
 
-if sys.hexversion >= 0x30200f0:
+if sys.version_info[0] >= 3:
     from urllib.request import urlopen
     py_input = input
     _unicode = str


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2015-01-01 17:44 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2015-01-01 17:44 UTC (permalink / raw
  To: gentoo-commits

commit:     198f91d769e9573f63cfcb3379c009957658f961
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 31 06:40:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 02:39:52 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=198f91d7

gkeygen/actions.py: Py 3 fixes

Both downloads in py3 are byte strings.  Need to decode them.
Change the "No password given" messages.
Add a logger.eror message with the GpgmeError received.

---
 gkeys-gen/gkeygen/actions.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index e329397..8ddf624 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -99,7 +99,7 @@ class Actions(object):
             shutil.copy('/usr/share/gnupg/gpg-conf.skel', newgpgconfpath)
             with open(newgpgconfpath, 'a') as conf:
                 for line in urlopen(self.config.get_key('gpg-urls', args.spec)):
-                    conf.write(_unicode(line))
+                    conf.write(_unicode(line.decode('utf-8')))
             # Key generation
             ctx = gpgme.Context()
             self.logger.info("MAIN: _action_genkey: Generating GPG key...")
@@ -109,9 +109,10 @@ class Actions(object):
                 "    This helps the random number generator work effectively"])
             try:
                 result = ctx.genkey(key_params)
-            except gpgme.GpgmeError:
-                self.logger.debug("MAIN: _action_genkey: Aborting... No given password.")
-                messages.extend(['', "Aborting... No given password."])
+            except gpgme.GpgmeError as e:
+                self.logger.error("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)
             key = ctx.get_key(result.fpr, True)
             self.logger.debug("MAIN: _action_genkey: Generated key: %s - %s"
@@ -139,5 +140,5 @@ class Actions(object):
         print("\nReview:\n Full Name: %s\n Email: %s\n" % (name, email))
         url = self.config.get_key('spec-urls', args.spec)
         key_properties = urlopen(url).read()
-        return _unicode(key_properties).format(name, email)
+        return _unicode(key_properties.decode('utf-8')).format(name, email)
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2015-01-06 21:45 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2015-01-06 21:45 UTC (permalink / raw
  To: gentoo-commits

commit:     038dee3c65047d6b076379612db9e7540aba92c9
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  6 21:15:02 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jan  6 21:19:40 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=038dee3c

gkeygen/actions.py: Add list-specs action, example

---
 gkeys-gen/gkeygen/actions.py | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index e118289..740d954 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -30,17 +30,28 @@ from gkeys.fileops import ensure_dirs
 
 
 Action_Map = OrderedDict({
-    'gen-key':  {
+    'gen-key': {
         'func': 'genkey',
         'options': ['spec', 'dest'],
         'desc': '''Generate a gpg key using a spec file''',
         'long_desc': '''Generate a gpg key using a spec file''',
         'example': '''''',
         },
+    'list-specs': {
+        'func': 'list_specs',
+        'options': [],
+        'desc': '''List spec file definitions (spec names) found in the config''',
+        'long_desc': '''List spec file definitions (spec names) found in the config.
+    The default-spec setting when the pkg was installed is set to glep-63-recommended.''',
+        'example': '''$ gkey-gen list-specs
+
+ Gkey task results:
+    Specs defined: glep-63,  default-spec,  glep-63-recommended
+''',
+        },
 })
 
-Available_Actions = list(Action_Map)
-
+Available_Actions = ['gen-key', 'list-specs']
 
 LARRY = """
     ____________________
@@ -149,3 +160,11 @@ class Actions(object):
         key_properties = urlopen(url).read()
         return _unicode(key_properties.decode('utf-8')).format(name, email)
 
+
+    def list_specs(self, args):
+        '''List seed file definitions found in the config'''
+        specs = list(self.config.get_key('spec'))
+        return (True, {"Specs defined: %s\n"
+            % (",  ".join(specs)): True})
+
+


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2015-01-06 21:45 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2015-01-06 21:45 UTC (permalink / raw
  To: gentoo-commits

commit:     284073e411a75c75efb0426ea444fc8783462bb5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  6 21:15:32 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jan  6 21:19:40 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=284073e4

gkeysgen/actions.py: Add gen-key example

---
 gkeys-gen/gkeygen/actions.py | 50 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index 740d954..8f8c81a 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -35,7 +35,55 @@ Action_Map = OrderedDict({
         'options': ['spec', 'dest'],
         'desc': '''Generate a gpg key using a spec file''',
         'long_desc': '''Generate a gpg key using a spec file''',
-        'example': '''''',
+        'example': '''$ gkey-gen gen-key
+
+    GPG key creator
+        Spec file..: glep-63-recommended
+        Homepage...: https://wiki.gentoo.org/wiki/GLEP:63
+
+Give your Full Name: Foo Barr
+Give your Email: foo@barr.net
+
+Review:
+ Full Name: Foo Barr
+ Email: foo@barr.net
+
+Continue?[y/n]: y
+
+* Creating gpg folder at /home/brian/gkeys-user/gpghome
+
+    * Creating gpg.conf file at /home/brian/gkeys-user/gpghome
+
+
+    ____________________
+    < Generating GPG key >
+     --------------------
+            \   ^__^
+             \  (oo)\_______
+                (__)\       )\/
+                    ||----w |
+                    ||     ||
+
+    * Give the password for the key. (Pick a strong one)
+        Please surf the internet, type on your keyboard, etc.
+        This helps the random number generator work effectively
+
+    Your new GLEP 63 based OpenPGP key has been created in /home/brian/gkeys-user/gpghome
+
+
+        GPG key info:
+            Full Name: Foo Barr,
+            Email: foo@barr.net,
+            Fingerprint: CF8F369903999538F79287497AD8F5FEF19A7A69
+
+
+    In order to use your new key, place the new gpghome to your ~/.gnupg folder by running the following command:
+        mv /home/brian/gkeys-user/gpghome ~/.gnupg
+    Important: If you have another old key in ~/.gnupg please make sure you backup it up first.
+
+    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
+''',
         },
     'list-specs': {
         'func': 'list_specs',


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2015-03-10 22:14 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2015-03-10 22:14 UTC (permalink / raw
  To: gentoo-commits

commit:     24e501c6dd471b69d262b27f254c197afcefc847
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 10 22:13:56 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Mar 10 22:13:56 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=24e501c6

gkeys-gen: Improve output by stating the error that occurred

The debug output in the log is not obvious, so stating it as well as the log file should help.

 gkeys-gen/gkeygen/actions.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index 649eed7..0bc34cd 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -27,6 +27,7 @@ else:
     _unicode = unicode
 
 from gkeys.fileops import ensure_dirs
+from gkeys import log
 
 
 Action_Map = OrderedDict([
@@ -174,8 +175,10 @@ class Actions(object):
                 result = ctx.genkey(key_params)
             except gpgme.GpgmeError as 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."])
+                self.logger.debug("MAIN: _action_genkey: Aborting... Gpgme errored out.")
+                messages.extend(['', "Aborting... Gpgme reported an error.\n",
+                    "    GpgmeError: %s\n" % str(e),
+                    "    See the log file for details: %s" % log.logname])
                 return (False, messages)
             key = ctx.get_key(result.fpr, True)
             self.logger.debug("MAIN: _action_genkey: Generated key: %s - %s"


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2016-03-01 16:18 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2016-03-01 16:18 UTC (permalink / raw
  To: gentoo-commits

commit:     73734eebcef4a9222c170375a3745d19c74f614e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  1 16:17:04 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Mar  1 16:17:04 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=73734eeb

gkeys-gen: Fix typo causing a traceback for bug 572890

X-Gentoo-bug: 572890
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=572890

 gkeys-gen/gkeygen/actions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index 0bc34cd..aaedcd1 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -149,7 +149,7 @@ class Actions(object):
             ack = py_input("Continue?[y/n]: ").lower()
         if ack in ["n", "no"]:
             messages.extend(['', "\nKey generation aborted."])
-            return (False. messages)
+            return (False, messages)
         elif ack in ["y", "yes"]:
             # Set the environment to custom gpg directory
             os.environ['GNUPGHOME'] = gpghome


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/
@ 2018-07-07  5:23 Brian Dolbec
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dolbec @ 2018-07-07  5:23 UTC (permalink / raw
  To: gentoo-commits

commit:     815569288668888bbd0df549f615a0813bfcb648
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  3 07:12:08 2018 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul  7 05:22:12 2018 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=81556928

gkeysgen/actions.py: Use gkeys py_input and _unicode declarations

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 gkeys-gen/gkeygen/actions.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index bd4a6ef..fc7a801 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -19,13 +19,13 @@ from collections import OrderedDict
 
 if sys.version_info[0] >= 3:
     from urllib.request import urlopen
-    py_input = input
-    _unicode = str
 else:
     from urllib2 import urlopen
-    py_input = raw_input
-    _unicode = unicode
 
+from gkeys import (
+    py_input,
+    _unicode,
+)
 from gkeys.fileops import ensure_dirs
 from gkeys import log
 
@@ -140,7 +140,7 @@ class Actions(object):
         shutil.copy(skelconfpath, newgpgconfpath)
         with open(newgpgconfpath, 'a') as conf:
             for line in urlopen(self.config.get_key('gpg-urls', args.spec)):
-                conf.write(_unicode(line.decode('utf-8'))) 
+                conf.write(_unicode(line.decode('utf-8')))
 
 
     def genkey(self, args):


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-07  5:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-07  5:23 [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2016-03-01 16:18 Brian Dolbec
2015-03-10 22:14 Brian Dolbec
2015-01-06 21:45 Brian Dolbec
2015-01-06 21:45 Brian Dolbec
2015-01-01 17:44 Brian Dolbec
2014-12-26  5:02 Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox