def wait_for(self, condition):
    'Repeatedly calls condition() until a timeout.'
    start_time = int(time.time())
    while True:
        try:
            condition()
        except Exception:
            pass
        else:
            return
        if ((int(time.time()) - start_time) >= self.build_timeout):
            condition()
            return
        time.sleep(self.build_interval)
Repeatedly calls condition() until a timeout.
def wait_for(self, condition):
    
    start_time = int(time.time())
    while True:
        try:
            condition()
        except Exception:
            pass
        else:
            return
        if ((int(time.time()) - start_time) >= self.build_timeout):
            condition()
            return
        time.sleep(self.build_interval)