twistedr.schedule_call: better name for an internal function, removed redundant call to timer_finished

This commit is contained in:
Denis Bilenko
2008-11-18 13:39:30 +06:00
parent 5526f56733
commit 53dfdd7c9e

View File

@@ -113,13 +113,13 @@ class BaseTwistedHub(object):
def schedule_call(self, seconds, func, *args, **kwargs):
from twisted.internet import reactor
def call_func_finish_time(*args, **kwargs):
def call_with_timer_attached(*args1, **kwargs1):
try:
return func(*args, **kwargs)
return func(*args1, **kwargs1)
finally:
self.timer_finished(timer)
timer = callLater(reactor, seconds, call_func_finish_time, *args, **kwargs)
if seconds:
self.timer_finished(timer)
timer = callLater(reactor, seconds, call_with_timer_attached, *args, **kwargs)
if seconds:
self.track_timer(timer)
return timer