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

commit:     c2e01ecee2f14ca8a4419433e43a50f5f7489376
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 31 02:50:20 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan  1 02:39:51 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=c2e01ece

gkeys-gen: Add spec option

Action config changes

---
 gkeys-gen/gkeygen/actions.py | 13 ++++++++-----
 gkeys/gkeys/base.py          |  5 +++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/gkeys-gen/gkeygen/actions.py b/gkeys-gen/gkeygen/actions.py
index b3aecb9..e329397 100644
--- a/gkeys-gen/gkeygen/actions.py
+++ b/gkeys-gen/gkeygen/actions.py
@@ -30,7 +30,7 @@ from gkeys.fileops import ensure_dirs
 Available_Actions = ["gen-key"]
 
 Action_Options = {
-    'gen-key': ['dest'],
+    'gen-key': ['dest', 'spec'],
 }
 
 Action_Map = {
@@ -77,7 +77,9 @@ class Actions(object):
                 return (False, messages)
         self.logger.debug("MAIN: _action_genkey; setting gpghome destination: %s" % gpghome)
         self.logger.debug("MAIN: _action_genkey; args= %s" % str(args))
-        key_params = self.get_input()
+        if not args.spec:
+            args.spec = self.config.get_key('spec', 'default-spec')
+        key_params = self.get_input(args)
         ack = None
         while ack not in ["y", "yes", "n", "no"]:
             ack = py_input("Continue?[y/n]: ").lower()
@@ -96,7 +98,7 @@ class Actions(object):
             newgpgconfpath = os.path.join(gpghome, 'gpg.conf')
             shutil.copy('/usr/share/gnupg/gpg-conf.skel', newgpgconfpath)
             with open(newgpgconfpath, 'a') as conf:
-                for line in urlopen(self.config.defaults['gpg.conf-url']):
+                for line in urlopen(self.config.get_key('gpg-urls', args.spec)):
                     conf.write(_unicode(line))
             # Key generation
             ctx = gpgme.Context()
@@ -125,7 +127,7 @@ class Actions(object):
             return (True, messages)
 
 
-    def get_input(self):
+    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"])
@@ -135,6 +137,7 @@ class Actions(object):
             self.output(["\nBad email input. Try again."])
             email = py_input("Give your Email: ")
         print("\nReview:\n Full Name: %s\n Email: %s\n" % (name, email))
-        key_properties = urlopen(self.config.defaults['key-spec-url']).read()
+        url = self.config.get_key('spec-urls', args.spec)
+        key_properties = urlopen(url).read()
         return _unicode(key_properties).format(name, email)
 

diff --git a/gkeys/gkeys/base.py b/gkeys/gkeys/base.py
index 6e53f87..5c9505d 100644
--- a/gkeys/gkeys/base.py
+++ b/gkeys/gkeys/base.py
@@ -174,6 +174,11 @@ class CliBase(object):
            help='The path/URL to use for the signature')
 
     @staticmethod
+    def _option_spec(parser=None):
+        parser.add_argument('-S', '--spec', dest='spec', default=None,
+            help='The spec file to use from the gkeys-gen.conf file')
+
+    @staticmethod
     def _option_timestamp(parser=None):
         parser.add_argument('-t', '--timestamp', dest='timestamp',
             action='store_true', default=False,


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

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

commit:     3b8f2bad274be6c6f55a19d715fb87c4ad2898bd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  6 21:16:29 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=3b8f2bad

gkeys, gkeys-gen: set version to "0.1"

---
 gkeys-gen/gkeygen/__init__.py | 2 +-
 gkeys/gkeys/__init__.py       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gkeys-gen/gkeygen/__init__.py b/gkeys-gen/gkeygen/__init__.py
index 495f798..e990779 100644
--- a/gkeys-gen/gkeygen/__init__.py
+++ b/gkeys-gen/gkeygen/__init__.py
@@ -6,7 +6,7 @@ from collections import OrderedDict
 from gkeygen.actions import Action_Map, Available_Actions
 
 
-__version__ = 'Git'
+__version__ = '0.1'
 __license__ = 'GPLv2'
 
 

diff --git a/gkeys/gkeys/__init__.py b/gkeys/gkeys/__init__.py
index 7256297..503d359 100644
--- a/gkeys/gkeys/__init__.py
+++ b/gkeys/gkeys/__init__.py
@@ -8,7 +8,7 @@ from collections import OrderedDict
 from gkeys.action_map import Action_Map, Available_Actions
 
 
-__version__ = 'Git'
+__version__ = '0.1'
 __license__ = 'GPLv2'
 
 


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

end of thread, other threads:[~2015-01-06 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-01 17:44 [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/, gkeys-gen/gkeygen/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2015-01-06 21:45 Brian Dolbec

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