yieldplotlib.core.directory_node#
Represents a directory containing multiple nodes (files or subdirectories).
Classes#
Represents a directory containing multiple nodes (files or subdirectories). |
Module Contents#
- class yieldplotlib.core.directory_node.DirectoryNode(directory_path)[source]#
Bases:
yieldplotlib.core.node.NodeRepresents a directory containing multiple nodes (files or subdirectories).
- Parameters:
directory_path (pathlib.Path)
- directory_path#
- directory_name#
- _children = []#
- add(node)[source]#
Add a child node to the directory.
- Parameters:
node (yieldplotlib.core.node.Node)
- get(key, **kwargs)[source]#
Recursively search for data associated with the given key.
- Parameters:
key (str)
- display_tree(level=0, max_children=5, prefix='')[source]#
Recursively display the tree structure.
- Args:
- level (int):
The current level of the tree.
- max_children (int):
The maximum number of children to display.
- prefix (str):
The prefix to display at the current level.
- _create_directory_node(path)[source]#
Create a directory node for the given path.
- Parameters:
path (pathlib.Path)
- Return type:
- _create_file_node(path)[source]#
Create a file node for the given path.
- Parameters:
path (pathlib.Path)
- Return type: