Get the substate. Args: path: The path to the substate. Returns: The substate. Raises: ValueError: If the substate is not found.
(self, path: Sequence[str])
| 1615 | substate._reset_client_storage() |
| 1616 | |
| 1617 | def get_substate(self, path: Sequence[str]) -> BaseState: |
| 1618 | """Get the substate. |
| 1619 | |
| 1620 | Args: |
| 1621 | path: The path to the substate. |
| 1622 | |
| 1623 | Returns: |
| 1624 | The substate. |
| 1625 | |
| 1626 | Raises: |
| 1627 | ValueError: If the substate is not found. |
| 1628 | """ |
| 1629 | if len(path) == 0: |
| 1630 | return self |
| 1631 | if path[0] == self.get_name(): |
| 1632 | if len(path) == 1: |
| 1633 | return self |
| 1634 | path = path[1:] |
| 1635 | if path[0] not in self.substates: |
| 1636 | msg = f"Invalid path: {path}" |
| 1637 | raise ValueError(msg) |
| 1638 | return self.substates[path[0]].get_substate(path[1:]) |
| 1639 | |
| 1640 | @classmethod |
| 1641 | def _get_potentially_dirty_states(cls) -> set[type[BaseState]]: |