fix some pr feedbacks
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Rio Liu 2021-08-30 16:55:46 -04:00
parent 01d02fe66c
commit 6b289a1ec4
1 changed files with 4 additions and 3 deletions

View File

@ -24,7 +24,7 @@ def get():
@positions.command(short_help='Update positions') @positions.command(short_help='Update positions')
def update(**kwargs): def set(**kwargs):
click.echo('The positions will be updated:') click.echo('The positions will be updated:')
print_colon_kv(kwargs.items()) print_colon_kv(kwargs.items())
click.confirm('Do you want to continue?', abort=True) click.confirm('Do you want to continue?', abort=True)
@ -37,7 +37,7 @@ def update(**kwargs):
@component.provideHandler @component.provideHandler
@component.adapter(IRegistered) @component.adapter(IRegistered)
def _handler(event): def _handler(event):
global update global set
if not (IUtilityRegistration.providedBy(event.object) and IConfig.providedBy(event.object.component)): if not (IUtilityRegistration.providedBy(event.object) and IConfig.providedBy(event.object.component)):
return return
@ -47,4 +47,5 @@ def _handler(event):
required = cfg.get('positions_required') required = cfg.get('positions_required')
for pos in avail: for pos in avail:
update = click.option(f'--{pos}', metavar='USER', required=(pos in required))(update) r = pos in required
set = click.option(f'--{pos}', metavar='USERNAME', required=r, prompt=r)(set)