Example #1
0
 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)
Example #2
0
File: wait.py Project: smurfix/MoaT
	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)
Example #3
0
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)
Example #4
0
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)