MCPcopy
hub / github.com/Textualize/textual / _add_to_load_queue

Method _add_to_load_queue

src/textual/widgets/_directory_tree.py:187–204  ·  view source on GitHub ↗

Add the given node to the load queue. The return value can optionally be awaited until the queue is empty. Args: node: The node to add to the load queue. Returns: An optionally awaitable object that can be awaited until the load queu

(self, node: TreeNode[DirEntry])

Source from the content-addressed store, hash-verified

185 self.path = path
186
187 def _add_to_load_queue(self, node: TreeNode[DirEntry]) -> AwaitComplete:
188 """Add the given node to the load queue.
189
190 The return value can optionally be awaited until the queue is empty.
191
192 Args:
193 node: The node to add to the load queue.
194
195 Returns:
196 An optionally awaitable object that can be awaited until the
197 load queue has finished processing.
198 """
199 assert node.data is not None
200 if not node.data.loaded:
201 node.data.loaded = True
202 self._load_queue.put_nowait(node)
203
204 return AwaitComplete(self._load_queue.join())
205
206 def reload(self) -> AwaitComplete:
207 """Reload the `DirectoryTree` contents.

Callers 1

Calls 3

AwaitCompleteClass · 0.90
put_nowaitMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected