Merge branch '4.x_rewrite' of square-r00t.net:bdisk into 4.x_rewrite
This commit is contained in:
commit
8278c55cab
@ -257,6 +257,55 @@ class prompts(object):
|
|||||||
while not _a:
|
while not _a:
|
||||||
if 'algo' in gpg_vals['attribs'] and a == 'keysize':
|
if 'algo' in gpg_vals['attribs'] and a == 'keysize':
|
||||||
_algo = gpg_vals['attribs']['algo']
|
_algo = gpg_vals['attribs']['algo']
|
||||||
|
_choices = _attribs['keysize']['choices'][_algo]
|
||||||
|
_dflt = _attribs['keysize']['default'][_algo]
|
||||||
|
else:
|
||||||
|
_choices = _attribs[a]['choices']
|
||||||
|
_dflt = _attribs[a]['default']
|
||||||
|
_a = (input(
|
||||||
|
('\nWhat should be {0}? (Default is {1}.)\nChoices:\n'
|
||||||
|
'\n\t{2}\n\n{3}: ').format(
|
||||||
|
_attribs[a]['text'],
|
||||||
|
_dflt,
|
||||||
|
'\n\t'.join(_choices),
|
||||||
|
a.title()
|
||||||
|
)
|
||||||
|
)).strip().lower()
|
||||||
|
if _a == '':
|
||||||
|
_a = _dflt
|
||||||
|
elif _a not in _choices:
|
||||||
|
_a = _dflt
|
||||||
|
else:
|
||||||
|
print('_dflt:', _dflt)
|
||||||
|
print('_choices:', _choices)
|
||||||
|
print('Invalid selection. Retrying.')
|
||||||
|
_a = None
|
||||||
|
continue
|
||||||
|
gpg_vals['attribs'][a] = _a
|
||||||
|
for p in _params:
|
||||||
|
_p = (input(
|
||||||
|
('\nWhat is the {0} for the subkey?\n{1}: ').format(
|
||||||
|
p, p.title())
|
||||||
|
))
|
||||||
|
if p == 'name':
|
||||||
|
if _p.strip() == '':
|
||||||
|
print('Name cannot be blank.')
|
||||||
|
_p = None
|
||||||
|
while not _p:
|
||||||
|
_p = input(('\n{0}: ').format(p.title()))
|
||||||
|
if _p.strip() == '':
|
||||||
|
print('Trying again.')
|
||||||
|
_p = None
|
||||||
|
continue
|
||||||
|
continue
|
||||||
|
elif _params[p]:
|
||||||
|
if not _params[p](_p):
|
||||||
|
print('Invalid entry. Retrying...')
|
||||||
|
_p = None
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
gpg_vals['params'][p] = _p
|
||||||
|
=======
|
||||||
_choices = _strs['attribs']['keysize']['choices'][_algo]
|
_choices = _strs['attribs']['keysize']['choices'][_algo]
|
||||||
_dflt = _strs['attribs']['keysize']['default'][_algo]
|
_dflt = _strs['attribs']['keysize']['default'][_algo]
|
||||||
else:
|
else:
|
||||||
@ -294,6 +343,7 @@ class prompts(object):
|
|||||||
)
|
)
|
||||||
_p = input('{0}: '.format(_p.title()))
|
_p = input('{0}: '.format(_p.title()))
|
||||||
gpg_vals['params'][p] = _p
|
gpg_vals['params'][p] = _p
|
||||||
|
>>>>>>> 69b6ec60d05d64a9e23e9a0707a0323f960a2936
|
||||||
return(gpg_vals)
|
return(gpg_vals)
|
||||||
|
|
||||||
def hash_select(self, prompt = '',
|
def hash_select(self, prompt = '',
|
||||||
|
Loading…
Reference in New Issue
Block a user