Onionr/onionr/utils/definewait.py

9 lines
219 B
Python
Raw Normal View History

2019-08-04 04:52:57 +00:00
import time
def define_wait(dictionary, key, delay: int = 0):
while True:
try:
return dictionary[key]
except KeyError:
pass
if delay > 0:
time.sleep(delay)