MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / wait

Function wait

python/demo_tools/retries.py:15–32  ·  view source on GitHub ↗

Waits for a specified number of seconds, while also displaying an animated spinner. :param seconds: The number of seconds to wait. :param tick: The number of frames per second used to animate the spinner.

(seconds, tick=12)

Source from the content-addressed store, hash-verified

13
14
15def wait(seconds, tick=12):
16 """
17 Waits for a specified number of seconds, while also displaying an animated
18 spinner.
19
20 :param seconds: The number of seconds to wait.
21 :param tick: The number of frames per second used to animate the spinner.
22 """
23 progress = "|/-\\"
24 waited = 0
25 while waited < seconds:
26 for frame in range(tick):
27 sys.stdout.write(f"\r{progress[frame % len(progress)]}")
28 sys.stdout.flush()
29 time.sleep(1 / tick)
30 waited += 1
31 sys.stdout.write("\r")
32 sys.stdout.flush()
33
34
35class ExponentialRetry:

Callers 15

wait_for_instancesFunction · 0.90
run_scenarioFunction · 0.90
create_clusterMethod · 0.90
create_instanceMethod · 0.90
create_snapshotMethod · 0.90
cleanupMethod · 0.90
run_scenarioMethod · 0.90
usage_demoFunction · 0.90
usage_demoFunction · 0.90
run_scenarioFunction · 0.90
_create_lambda_roleMethod · 0.90

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected