Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/change-ea-behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushuk authored Feb 18, 2024
2 parents 1efc488 + 08c0874 commit fc830a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
12 changes: 7 additions & 5 deletions pros/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def callback(ctx: click.Context, param: click.Parameter, value: bool):
add_tag('no-sentry',value)
if value:
pros.common.sentry.disable_prompt()
decorator = click.option('--no-sentry', expose_value=False, is_flag=True, default=False, is_eager=True,
decorator = click.option('--no-sentry', expose_value=False, is_flag=True, default=True, is_eager=True,
help="Disable sentry reporting prompt.", callback=callback, cls=PROSOption, hidden=True)(f)
decorator.__name__ = f.__name__
return decorator
Expand Down Expand Up @@ -256,11 +256,13 @@ def resolve_v5_port(port: Optional[str], type: str, quiet: bool = False) -> Tupl
return None, False
if len(ports) > 1:
if not quiet:
port = click.prompt('Multiple {} ports were found. Please choose one: [{}]'
.format('v5', '|'.join([p.device for p in ports])),
default=ports[0].device,
brain_id = click.prompt('Multiple {} Brains were found. Please choose one to upload the program: [{}]'
.format('v5', ' | '.join([p.product.split(' ')[-1] for p in ports])),
default=ports[0].product.split(' ')[-1],
show_default=False,
type=click.Choice([p.device for p in ports]))
type=click.Choice([p.description.split(' ')[-1] for p in ports]))
port = [p.device for p in ports if p.description.split(' ')[-1] == brain_id][0]

assert port in [p.device for p in ports]
else:
return None, False
Expand Down
3 changes: 1 addition & 2 deletions pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,


@conductor.command('query-templates',
aliases=['search-templates', 'ls-templates', 'lstemplates', 'querytemplates', 'searchtemplates'],
aliases=['search-templates', 'ls-templates', 'lstemplates', 'querytemplates', 'searchtemplates', 'q'],
context_settings={'ignore_unknown_options': True})
@click.option('--allow-offline/--no-offline', 'allow_offline', default=True, show_default=True,
help='(Dis)allow offline templates in the listing')
Expand Down Expand Up @@ -392,4 +392,3 @@ def reset(force: bool):
os.remove(file)

ui.echo("Conductor was reset")

2 changes: 1 addition & 1 deletion pros/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __str__(self):
result.append(PortReport('VEX EDR V5 System Ports', ports, 'v5/system'))

ports = find_v5_ports('User')
result.append(PortReport('VEX EDR V5 User ports', ports, 'v5/user'))
result.append(PortReport('VEX EDR V5 User Ports', ports, 'v5/user'))
if target == 'cortex' or target is None:
ports = find_cortex_ports()
result.append(PortReport('VEX EDR Cortex Microcontroller Ports', ports, 'cortex'))
Expand Down
4 changes: 2 additions & 2 deletions pros/cli/v5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def capture(file_name: str, port: str, force: bool = False):

print(f'Saved screen capture to {file_name}')

@v5.command(aliases=['sv', 'set'], short_help='Set a kernel variable on a connected V5 device')
@v5.command('set-variable', aliases=['sv', 'set', 'set_variable'], short_help='Set a kernel variable on a connected V5 device')
@click.argument('variable', type=click.Choice(['teamnumber', 'robotname']), required=True)
@click.argument('value', required=True, type=click.STRING, nargs=1)
@click.argument('port', type=str, default=None, required=False)
Expand All @@ -308,7 +308,7 @@ def set_variable(variable, value, port):
actual_value = device.kv_write(variable, value).decode()
print(f'Value of \'{variable}\' set to : {actual_value}')

@v5.command(aliases=['rv', 'get'], short_help='Read a kernel variable from a connected V5 device')
@v5.command('read-variable', aliases=['rv', 'get', 'read_variable'], short_help='Read a kernel variable from a connected V5 device')
@click.argument('variable', type=click.Choice(['teamnumber', 'robotname']), required=True)
@click.argument('port', type=str, default=None, required=False)
@default_options
Expand Down

0 comments on commit fc830a9

Please sign in to comment.