aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-01-03 10:08:48 -0800
committerBrian Dolbec <dolsen@gentoo.org>2015-01-05 14:14:36 -0800
commit147295dbd64a178a918a41341aa12fc14ecd63f8 (patch)
tree45a41002464be62e8af2c3e902b7e017a108347b /gkeys/gkeys/actions.py
parentgkeyldap/actions.py: Add generated default uid to seed data (diff)
downloadgentoo-keys-147295dbd64a178a918a41341aa12fc14ecd63f8.tar.gz
gentoo-keys-147295dbd64a178a918a41341aa12fc14ecd63f8.tar.bz2
gentoo-keys-147295dbd64a178a918a41341aa12fc14ecd63f8.zip
gkeys: Move Action_Map and other non-operation data to action_map.py
This removes the bloat of the man page data and makes obtaining the data less taxing for non-operational needs. Update Action_options import change Add list-key example Update more actions
Diffstat (limited to 'gkeys/gkeys/actions.py')
-rw-r--r--gkeys/gkeys/actions.py183
1 files changed, 1 insertions, 182 deletions
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index b63f3f1..cfcc038 100644
--- a/gkeys/gkeys/actions.py
+++ b/gkeys/gkeys/actions.py
@@ -21,7 +21,7 @@ else:
py_input = raw_input
-from collections import defaultdict, OrderedDict
+from collections import defaultdict
from json import load
from shutil import rmtree
@@ -31,187 +31,6 @@ from gkeys.gkey import GKEY
from gkeys.checks import SPECCHECK_SUMMARY, convert_pf, convert_yn
-Seed_Actions = ['----seeds----', 'add-seed', 'fetch-seed',
- 'list-seed', 'list-seedfiles', 'move-seed', 'remove-seed']
-
-Key_Actions = ['----keys-----', 'check-key', 'installed',
- 'install-key', 'list-key', 'move-key', 'refresh-key', 'remove-key',
- 'search-key', 'spec-check']
-
-General_Actions = ['---general---', 'list-cats', 'sign','verify']
-
-Available_Actions = General_Actions + Key_Actions + Seed_Actions
-
-Action_Map = OrderedDict({
- '---general---': {
- 'func': 'GENERAL_COMMANDS',
- 'options': [],
- 'desc': '''-----< general actions >------''',
- 'long_desc': '''''',
- 'example': '''''',
- },
- 'list-cats': {
- 'func': 'listcats',
- 'options': [],
- 'desc': '''List seed file definitions (category names) found in the config''',
- 'long_desc': '''List seed file definitions (category names) found in the config.
- These category names are used throughout the seed and key action operations.''',
- 'example': '''''',
- },
- 'sign': {
- 'func': 'sign',
- 'options': ['nick', 'name', 'fingerprint', 'file', ],
- 'desc': '''Sign a file''',
- 'long_desc': '''Sign a file''',
- 'example': '''''',
- },
- 'verify': {
- 'func': 'verify',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keydir', 'keys', '1file', 'signature', 'timestamp', 'dest'],
- 'desc': '''File automatic download and/or verification action.''',
- 'long_desc': '''File automatic download and/or verification action.
- Note: If the specified key/keyring to verify against does not contain
- the key used to sign the file. It will Auto-search for the correct key
- in the installed keys db. And verify against the matching key.
- It will report the success/failure along with the key information used for
- the verification''',
- 'example': '''''',
- },
- '----keys-----': {
- 'func': 'KEY_COMMANDS',
- 'options': [],
- 'desc': '''-------< key actions >--------''',
- 'long_desc': '',
- 'example': '',
- },
- 'check-key': {
- 'func': 'checkkey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keyid', 'keys', 'keydir', 'keyring'],
- 'desc': '''Check keys actions
- Performs basic validity checks on the key(s), checks expiry,
- and presence of a signing sub-key''',
- 'long_desc': '''Check keys actions
- Performs basic validity checks on the key(s), checks expiry,
- and presence of a signing sub-key''',
- 'example': '''''',
- },
- 'import-key': {
- 'func': 'importkey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'keyring'],
- 'desc': '''Add a specified key to a specified keyring''',
- 'long_desc': '''Add a specified key to a specified keyring''',
- 'example': '''''',
- },
- 'install-key': {
- 'func': 'installkey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'keyring', '1file'],
- 'desc': '''Install a key from the seed(s)''',
- 'long_desc': '''Install a key from the seed(s)''',
- 'example': '''''',
- },
- 'installed': {
- 'func': 'installed',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'keyring'],
- 'desc': '''Lists the installed key directories''',
- 'long_desc': '''Lists the installed key directories''',
- 'example': '''''',
- },
- 'list-key': {
- 'func': 'listkey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keyid', 'keys', 'keydir', 'keyring', 'gpgsearch'],
- 'desc': '''Pretty-print the selected gpg key''',
- 'long_desc': '''Pretty-print the selected gpg key''',
- 'example': '''''',
- },
- 'move-key': {
- 'func': 'movekey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'keyring', 'dest'],
- 'desc': '''Rename an installed keydir''',
- 'long_desc': '''Rename an installed keydir''',
- 'example': '''''',
- },
- 'refresh-key': {
- 'func': 'refreshkey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keyid', 'keys', 'keydir', 'keyring'],
- 'desc': '''Calls gpg with the --refresh-keys option
- for in place updates of the installed keys''',
- 'long_desc': '''Calls gpg with the --refresh-keys option
- for in place updates of the installed keys''',
- 'example': '''''',
- },
- 'remove-key': {
- 'func': 'removekey',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'keyring'],
- 'desc': '''Remove (uninstall) an installed key''',
- 'long_desc': '''Remove (uninstall) an installed key''',
- 'example': '''''',
- },
- 'search-key': {
- 'func': 'key_search',
- 'options': ['category', 'nick', '1name', 'fingerprint', 'keyid', 'uid', 'keys', 'keydir', 'exact', 'all'],
- 'desc': '''Search for a key's seed in the installed keys db''',
- 'long_desc': '''Search for a key's seed in the installed keys db''',
- 'example': '''''',
- },
- 'spec-check': {
- 'func': 'speccheck',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keyid', 'keys', 'keydir', 'keyring'],
- 'desc': '''Check if keys meet specifications requirements''',
- 'long_desc': '''Check if keys meet specifications requirements''',
- 'example': '''''',
- },
- '----seeds----': {
- 'func': 'SEED_COMMANDS',
- 'options': [],
- 'desc': '''------< seed actions >-------''',
- 'long_desc': '',
- 'example': '',
- },
- 'add-seed': {
- 'func': 'addseed',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', 'uid'],
- 'desc': '''Add or replace a key in the selected seed file''',
- 'long_desc': '''Add or replace a key in the selected seed file''',
- 'example': '''''',
- },
- 'fetch-seed': {
- 'func': 'fetchseed',
- 'options': ['category', 'nick', '1file', 'dest', 'signature', 'timestamp'],
- 'desc': '''Download the selected seed file(s)''',
- 'long_desc': '''Download the selected seed file(s)''',
- 'example': '''''',
- },
- 'list-seed': {
- 'func': 'listseed',
- 'options': ['category', 'nick', 'name', 'fingerprint', 'keys', 'keydir', '1file'],
- 'desc': '''Pretty-print the selected seed file''',
- 'long_desc': '''Pretty-print the selected seed file''',
- 'example': '''''',
- },
- 'list-seedfiles': {
- 'func': 'listseedfiles',
- 'options': [],
- 'desc': '''List seed files found in the configured seed directory''',
- 'long_desc': '''List seed files found in the configured seed directory''',
- 'example': '''''',
- },
- 'move-seed': {
- 'func': 'moveseed',
- 'options': ['category', 'nick', 'name', 'keydir', 'keys', 'fingerprint', 'dest'],
- 'desc': '''Move keys between seed files''',
- 'long_desc': '''Move keys between seed files''',
- 'example': '''''',
- },
- 'remove-seed': {
- 'func': 'removeseed',
- 'options': ['category', 'nick', 'name', 'keys', 'fingerprint', 'keydir'],
- 'desc': '''Remove a seed from the selected seed file''',
- 'long_desc': '''Remove a seed from the selected seed file''',
- 'example': '''''',
- },
-})
-
-
class Actions(object):
'''Primary API actions'''