def _pling(self, timeout): #log(TRACE,"WaitEnter",self.name,self.force,timeout) sleep(self.force, timeout, self.name) #log(TRACE,"WaitDone Del",self.name) assert self._plinger is not None self._plinger = None super(Waiter, self).delete() self.job.set(True)
def _pling(self,timeout): #log(TRACE,"WaitEnter",self.name,self.force,timeout) sleep(self.force, timeout, self.name) #log(TRACE,"WaitDone Del",self.name) assert self._plinger is not None self._plinger = None super(Waiter,self).delete() self.job.set(True)
def sleepUntil(force,delta): from moat.times import unixdelta,now,sleep if isinstance(delta,dt.datetime): delta = delta - now() if isinstance(delta,dt.timedelta): delta = unixdelta(delta) if delta < 0: # we're late delta = 0 # but let's hope not too late sleep(force,delta)
def sleepUntil(force, delta): from moat.times import unixdelta, now, sleep if isinstance(delta, dt.datetime): delta = delta - now() if isinstance(delta, dt.timedelta): delta = unixdelta(delta) if delta < 0: # we're late delta = 0 # but let's hope not too late sleep(force, delta)