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

Method to_string

camel/tasks/task.py:180–196  ·  view source on GitHub ↗

r"""Convert task to a sting. Args: indent (str): The ident for hierarchical tasks. state (bool): Include or not task state. Returns: str: The printable task string.

(self, indent: str = "", state: bool = False)

Source from the content-addressed store, hash-verified

178 return None
179
180 def to_string(self, indent: str = "", state: bool = False) -> str:
181 r"""Convert task to a sting.
182
183 Args:
184 indent (str): The ident for hierarchical tasks.
185 state (bool): Include or not task state.
186
187 Returns:
188 str: The printable task string.
189 """
190 if state:
191 _str = f"{indent}[{self.state}] Task {self.id}: {self.content}\n"
192 else:
193 _str = f"{indent}Task {self.id}: {self.content}\n"
194 for subtask in self.subtasks:
195 _str += subtask.to_string(indent + " ", state)
196 return _str
197
198 def get_result(self, indent: str = "") -> str:
199 r"""Get task result to a sting.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected