Timer does not fire off an event right away when starting anymore

pull/2/head
Paulus Schoutsen 2013-09-23 00:51:02 -07:00
parent 371b4c7708
commit 43921cb872
1 changed files with 5 additions and 5 deletions

View File

@ -36,11 +36,6 @@ class Timer(threading.Thread):
now = datetime.now()
while True:
if self._stop.isSet():
break
self.eventbus.fire(Event(EVENT_TIME_CHANGED, {'now':now}))
while True:
time.sleep(1)
@ -49,6 +44,11 @@ class Timer(threading.Thread):
if self._stop.isSet() or now.second % TIME_INTERVAL == 0:
break
if self._stop.isSet():
break
self.eventbus.fire(Event(EVENT_TIME_CHANGED, {'now':now}))
def track_time_change(eventbus, action, year='*', month='*', day='*', hour='*', minute='*', second='*', point_in_time=None, listen_once=False):
year, month, day = ensure_list(year), ensure_list(month), ensure_list(day)