treelib icon indicating copy to clipboard operation
treelib copied to clipboard

Call node "display" method instead of returning node "data_property" to have more flexibility

Open leonardbinet opened this issue 5 years ago • 0 comments

I am currently limited by how a tree is represented in show method. Currently, the __print_backend method displays a node based on his tag or a data_property.

In my case, I want to change display based on node depth in current tree.

One possibility to keep retro-compatibility would be to implement a display method on Node, returning by default the tag, with ability return a provided data_property, remaining **kwargs would allow specifying client defined behaviours by redefining display method by Node inheritance.

leonardbinet avatar Feb 22 '20 22:02 leonardbinet