equal
deleted
inserted
replaced
143 return name |
143 return name |
144 |
144 |
145 class LoopTask(object): |
145 class LoopTask(object): |
146 """threaded task restarting itself once executed""" |
146 """threaded task restarting itself once executed""" |
147 def __init__(self, tasks_manager, interval, func, args): |
147 def __init__(self, tasks_manager, interval, func, args): |
148 if interval <= 0: |
148 if interval < 0: |
149 raise ValueError('Loop task interval must be > 0 ' |
149 raise ValueError('Loop task interval must be >= 0 ' |
150 '(current value: %f for %s)' % \ |
150 '(current value: %f for %s)' % \ |
151 (interval, func_name(func))) |
151 (interval, func_name(func))) |
152 self._tasks_manager = tasks_manager |
152 self._tasks_manager = tasks_manager |
153 self.interval = interval |
153 self.interval = interval |
154 def auto_restart_func(self=self, func=func, args=args): |
154 def auto_restart_func(self=self, func=func, args=args): |