Skip to content

Commit

Permalink
add regex to skip OT-2's temp ports
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed May 8, 2024
1 parent 1be30f7 commit a000379
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/opentrons/hardware_control/module_control.py
Expand Up @@ -29,9 +29,11 @@
log = logging.getLogger(__name__)

MODULE_PORT_REGEX = re.compile(
# add a negative lookbehind to suppress matches on OT-2 tempfiles udev creates
r"(?<!\.#ot_module_)"
# capture all modules by name using alternation
"(" + "|".join(modules.MODULE_TYPE_BY_NAME.keys()) + ")"
# add a negative lookahead to suppress matches on tempfiles udev creates
+ "(" + "|".join(modules.MODULE_TYPE_BY_NAME.keys()) + ")"
# add a negative lookahead to suppress matches on Flex tempfiles udev creates
+ r"\d+(?!\.tmp-c\d+:\d+)",
re.I,
)
Expand Down

0 comments on commit a000379

Please sign in to comment.