aboutsummaryrefslogtreecommitdiff
path: root/gkeys
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-03-18 16:18:13 -0700
committerBrian Dolbec <dolsen@gentoo.org>2015-05-30 16:18:50 -0700
commitffe53b207532d165f3e6019e10ee27f23e0b3e84 (patch)
treed313367f2b40e1fb1b445902fe27177b61beecf4 /gkeys
parentgkeys/actionspy: Fix grammar in the confirmation input message (diff)
downloadgentoo-keys-ffe53b207532d165f3e6019e10ee27f23e0b3e84.tar.gz
gentoo-keys-ffe53b207532d165f3e6019e10ee27f23e0b3e84.tar.bz2
gentoo-keys-ffe53b207532d165f3e6019e10ee27f23e0b3e84.zip
gkeys: Remove gpgsearch option from list-key action
The default action for list-key is to now list all keys found in the keydir. Regardless if they are in the db's seed file for that keydir.
Diffstat (limited to 'gkeys')
-rw-r--r--gkeys/gkeys/action_map.py2
-rw-r--r--gkeys/gkeys/actions.py48
2 files changed, 11 insertions, 39 deletions
diff --git a/gkeys/gkeys/action_map.py b/gkeys/gkeys/action_map.py
index d547ab3..3b1b9d0 100644
--- a/gkeys/gkeys/action_map.py
+++ b/gkeys/gkeys/action_map.py
@@ -157,7 +157,7 @@ Found:
('list-key', {
'func': 'listkey',
'options': ['category', 'nick', 'name', 'fingerprint', 'keyid', 'keys',
- 'keydir', 'keyring', 'gpgsearch'],
+ 'keydir', 'keyring'],
'desc': '''Pretty-print the selected gpg key''',
'long_desc': '''Pretty-print the selected gpg key''',
'example': '''gkeys list-key -C gentoo -n gkeys
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index efab4fa..edbea0d 100644
--- a/gkeys/gkeys/actions.py
+++ b/gkeys/gkeys/actions.py
@@ -206,45 +206,17 @@ class Actions(object):
results = {}
success = []
messages = []
- if args.gpgsearch:
- keyresults = seeds.seeds
- # pick any key
- key = keyresults[sorted(keyresults)[0]]
- result = self.gpg.list_keys(key.keydir, args.gpgsearch)
- # now split the results and reverse lookup the gkey
- lines = result.output.split('\n')
- while lines:
- # determine the end of the first key listing
- index = lines.index('')
- keyinfo = lines[:index]
- # trim off the first keys info
- lines = lines[index + 1:]
- # make sure it is a key listing
- if len(keyinfo) < 2:
- break
- # get the fingerprint from the line
- fpr = keyinfo[1].split('= ')[1]
- # search for the matching gkey
- kwargs = {'keydir': args.keydir, 'fingerprint': [fpr]}
- keyresults = seeds.list(**kwargs)
- # list the results
- for key in sorted(keyresults):
- ls, lr = self._list_it(key, '\n'.join(keyinfo))
- success.append(ls)
- results[key.name] = lr
+ kwargs = handler.build_gkeydict(args)
+ keyresults = seeds.list(**kwargs)
+ for key in sorted(keyresults):
+ if args.fingerprint:
+ result = self.gpg.list_keys(key.keydir, kwargs['fingerprint'])
+ else:
+ result = self.gpg.list_keys(key.keydir)
+ ls, lr = self._list_it(key, result.output)
+ success.append(ls)
+ results[key.name] = lr
messages = ["Done."]
- else:
- kwargs = handler.build_gkeydict(args)
- keyresults = seeds.list(**kwargs)
- for key in sorted(keyresults):
- if args.fingerprint:
- result = self.gpg.list_keys(key.keydir, kwargs['fingerprint'])
- else:
- result = self.gpg.list_keys(key.keydir)
- ls, lr = self._list_it(key, result.output)
- success.append(ls)
- results[key.name] = lr
- messages = ["Done."]
if not messages:
messages = ['No results found meeting criteria', "Did you specify -n foo or -n '*'"]