Wait for the specified connectivity. This only works reliably if the connectivity doesn't change again too quickly, otherwise we might miss it.
(self, connectivity)
| 135 | return m.groups() |
| 136 | |
| 137 | def wait_for_connectivity(self, connectivity): |
| 138 | """Wait for the specified connectivity. |
| 139 | This only works reliably if the connectivity doesn't change |
| 140 | again too quickly, otherwise we might miss it. |
| 141 | """ |
| 142 | while True: |
| 143 | if self.account.get_connectivity() == connectivity: |
| 144 | return |
| 145 | self.get_matching("DC_EVENT_CONNECTIVITY_CHANGED") |
| 146 | |
| 147 | def wait_for_connectivity_change(self, previous, expected_next): |
| 148 | """Wait until the connectivity changes to `expected_next`. |