From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 02044138ACF for ; Tue, 6 Jan 2015 21:45:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 479D7E0841; Tue, 6 Jan 2015 21:45:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3022EE083E for ; Tue, 6 Jan 2015 21:45:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 437D2340740 for ; Tue, 6 Jan 2015 21:45:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DE13BF049 for ; Tue, 6 Jan 2015 21:45:36 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420579180.038dee3c65047d6b076379612db9e7540aba92c9.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys-gen/gkeygen/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys-gen/gkeygen/actions.py X-VCS-Directories: gkeys-gen/gkeygen/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 038dee3c65047d6b076379612db9e7540aba92c9 X-VCS-Branch: master Date: Tue, 6 Jan 2015 21:45:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 69b2aca0-1eb6-42dc-9b71-f8b3dd81090b X-Archives-Hash: 4d943d3d75c3795338f70f081cfcc569 commit: 038dee3c65047d6b076379612db9e7540aba92c9 Author: Brian Dolbec gentoo org> AuthorDate: Tue Jan 6 21:15:02 2015 +0000 Commit: Brian Dolbec gentoo 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}) + +