Skip to content

Commit

Permalink
script option to set the operator name without a prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
fsinapi committed Aug 17, 2023
1 parent 61fdbf7 commit ca9750b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ async def get_test_metadata(
) -> Tuple[str, str]:
"""Get the operator name and robot serial number."""
if arguments.no_input:
_operator = "None"
_operator = args.operator if isinstance(args.operator, str) else "None"
_robot_id = api._backend.eeprom_data.serial_number
if not _robot_id:
ui.print_error("no serial number saved on this robot")
Expand All @@ -810,7 +810,10 @@ async def get_test_metadata(
if not _robot_id:
ui.print_error("no serial number saved on this robot")
_robot_id = input("enter ROBOT SERIAL number: ").strip()
_operator = input("enter OPERATOR name: ")
if isinstance(args.operator, str):
_operator = args.operator
else:
_operator = input("enter OPERATOR name: ")

return (_operator, _robot_id)

Expand Down Expand Up @@ -927,6 +930,7 @@ async def _main(arguments: argparse.Namespace) -> None:

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--operator", type=str, default=None)
parser.add_argument("--simulate", action="store_true")
parser.add_argument("--cycles", type=int, default=20)
parser.add_argument("--skip_bowtie", action="store_true")
Expand Down

0 comments on commit ca9750b

Please sign in to comment.