data_base
❭ utils
❭ calc_recursive_filetree
calc_recursive_filetree¶
-
data_base.utils.calc_recursive_filetree(db, root_dir_path, max_lines=
30
, depth=0
, max_depth=2
, max_lines_per_key=3
, lines=None
, indent=None
, all_files=False
, colorize=True
)¶ Fetches the contents of an db and formats them as a string representing a tree structure
- Parameters:¶
db (data_base.data_base.DataNase) – The database to be visualized
root_dir_path (str) – The path to the root directory
max_depth (int) – Maximum depth to recurse into the directory tree
max_lines (int) – Maximum number of lines to print. Default is 30.
max_lines_per_key (int) – Maximum number of lines per key. Default is 3.
lines (list) – List of strings to append to during recursion. Default is
None
.all_files (bool) – If True, all files are shown (including e.g. /db subfolders). If False, only files that are keys in the database are shown. Default is
False
.colorize (bool) – If True, colorizes the keys. Default is
True
.
- Returns:¶
The formatted tree structure as a list of strings.
- Return type:¶
list