yieldplotlib.core.directory_node#

Represents a directory containing multiple nodes (files or subdirectories).

Classes#

DirectoryNode

Represents a directory containing multiple nodes (files or subdirectories).

Module Contents#

class yieldplotlib.core.directory_node.DirectoryNode(directory_path)[source]#

Bases: yieldplotlib.core.node.Node

Represents a directory containing multiple nodes (files or subdirectories).

Parameters:

directory_path (pathlib.Path)

directory_path#
directory_name#
_children = []#
load()[source]#

Recursively scan directories and load all child nodes.

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:

yieldplotlib.core.node.Node

_create_file_node(path)[source]#

Create a file node for the given path.

Parameters:

path (pathlib.Path)

Return type:

yieldplotlib.core.node.Node

create_base_file(path)[source]#

Create a base file node for the given path.

Parameters:

path (pathlib.Path)

create_base_directory(path)[source]#

Create a directory node for the given path.

Parameters:

path (pathlib.Path)