MCPcopy Create free account
hub / github.com/chatmail/core / wait_for_connectivity

Method wait_for_connectivity

python/src/deltachat/events.py:137–145  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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`.

Callers 1

test_connectivityFunction · 0.80

Calls 2

get_matchingMethod · 0.95
get_connectivityMethod · 0.45

Tested by 1

test_connectivityFunction · 0.64