def advanceCompletely(self, amount):
"""
Move time on this clock forward by the given amount and run whatever
pending calls should be run. Always complete the deferred calls before
returning.
@type amount: C{float}
@param amount: The number of seconds which to advance this clock's
time.
"""
self.rightNow += amount
self._sortCalls()
while self.calls and self.calls[0].getTime() <= self.seconds():
call = self.calls.pop(0)
call.called = 1
yield call.func(*call.args, **call.kw)
self._sortCalls()
评论列表
文章目录