'Wait observer is running and returns if observer has no more events (queue is empty)'

def wait_empty(self, sleeptime=None):

    time.sleep(ObserverThread.DEFAULT_SLEEP_INTERVAL)
    if (sleeptime is not None):
        e = (MyTime.time() + sleeptime)
    if (self._notify is not None):
        self.add_wn('nop')
        if (self.is_full and self.idle):
            self.pulse_notify()
    while self.is_full:
        if ((sleeptime is not None) and (MyTime.time() > e)):
            break
        time.sleep(ObserverThread.DEFAULT_SLEEP_INTERVAL)
    self.wait_idle(0.001)
    return (not self.is_full)
