def __init__(self, msg, sequential=True): Task.__init__(self, msg) self.subtasks = [] self.sequential = sequential for task in self.subtasks: task.parent = self
def _stop(self): """ Overridden to call stop on all children """ Task._stop(self) for subtask in self.subtasks: subtask._stop()
def __setattr__(self, key, value): Task.__setattr__(self, key, value) if key == 'subtask': value.parent = self
def __init__(self, msg='Demo Task'): Task.__init__(self, msg)
def __init__(self, msg=None): Task.__init__(self, msg) self._lock = Lock()