diff options
author | Brian Dolbec <dolsen@gentoo.org> | 2014-12-26 10:36:04 -0800 |
---|---|---|
committer | Brian Dolbec <dolsen@gentoo.org> | 2014-12-26 10:36:04 -0800 |
commit | 3fb60f5c114d9784bdc3609cdf20bd7062cf3044 (patch) | |
tree | 6b00f441f2b22c302b8f8d7aba9f28110af0a8b8 /gkeys-ldap | |
parent | gkeys/base.py: Add a justdoit option, fix boolean options (diff) | |
download | gentoo-keys-3fb60f5c114d9784bdc3609cdf20bd7062cf3044.tar.gz gentoo-keys-3fb60f5c114d9784bdc3609cdf20bd7062cf3044.tar.bz2 gentoo-keys-3fb60f5c114d9784bdc3609cdf20bd7062cf3044.zip |
Map sub commands to class functions
This allows the use of hypens in subcommands because
they are no longer directly mapped to the class function they initiate.
Do some more fine tuning of the grouping identifiers.
Diffstat (limited to 'gkeys-ldap')
-rw-r--r-- | gkeys-ldap/gkeyldap/actions.py | 5 | ||||
-rw-r--r-- | gkeys-ldap/gkeyldap/cli.py | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gkeys-ldap/gkeyldap/actions.py b/gkeys-ldap/gkeyldap/actions.py index 1d8e848..b543685 100644 --- a/gkeys-ldap/gkeyldap/actions.py +++ b/gkeys-ldap/gkeyldap/actions.py @@ -25,6 +25,11 @@ Action_Options = { 'updateseeds': ['fingerprint', 'mail', 'name', 'nick', 'category', 'status'], } +Action_Map = { + 'ldap-search': 'ldapsearch', + 'update-seeds': 'updateseeds', +} + def get_key_ids(key_len, keyids): '''Small utility function to return only keyid (short) diff --git a/gkeys-ldap/gkeyldap/cli.py b/gkeys-ldap/gkeyldap/cli.py index bb4f5c3..c85176f 100644 --- a/gkeys-ldap/gkeyldap/cli.py +++ b/gkeys-ldap/gkeyldap/cli.py @@ -12,7 +12,8 @@ from gkeys import seed from gkeys.base import CliBase from gkeys.config import GKeysConfig from gkeyldap import connect, search -from gkeyldap.actions import Actions, Available_Actions, Action_Options +from gkeyldap.actions import (Actions, Available_Actions, Action_Options, + Action_Map) class Main(CliBase): @@ -35,6 +36,7 @@ class Main(CliBase): 'Actions': Actions, 'Available_Actions': Available_Actions, 'Action_Options': Action_Options, + 'Action_Map': Action_Map, 'prog': 'gkey-ldap', 'description': 'Gentoo-keys LDAP interface and seed file generator program', 'epilog': '''CAUTION: adding UNTRUSTED keys can be HAZARDOUS to your system!''' |