MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / set_state

Method set_state

camel/tasks/task.py:140–152  ·  view source on GitHub ↗

r"""Recursively set the state of the task and its subtasks. Args: state (TaskState): The giving state.

(self, state: TaskState)

Source from the content-addressed store, hash-verified

138 self.id = id
139
140 def set_state(self, state: TaskState):
141 r"""Recursively set the state of the task and its subtasks.
142
143 Args:
144 state (TaskState): The giving state.
145 """
146 self.state = state
147 if state == TaskState.DONE:
148 for subtask in self.subtasks:
149 if subtask.state != TaskState.DELETED:
150 subtask.set_state(state)
151 elif state == TaskState.RUNNING and self.parent:
152 self.parent.set_state(state)
153
154 def add_subtask(self, task: "Task"):
155 r"""Add a subtask to the current task.

Callers 2

update_resultMethod · 0.95
_listen_to_channelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected