Skip to content
Snippets Groups Projects
Commit 0e938a55 authored by Ladislav Lhotka's avatar Ladislav Lhotka
Browse files

Fix node prefixes in ascii tree.

parent 50e21bcd
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ class SchemaNode:
self.mandatory = False
def _tree_line_prefix(self) -> str:
return "+--{}".format("rw" if self.config else "ro")
return "+--"
handler = {
"anydata": "anydata_stmt",
......@@ -276,6 +276,9 @@ class DataNode(SchemaNode):
super().__init__()
self.default_deny = DefaultDeny.none # type: "DefaultDeny"
def _tree_line_prefix(self) -> str:
return super()._tree_line_prefix() + ("rw" if self.config else "ro")
def _parse_entry_selector(self, iid: str, offset: int) -> Any:
"""This method is applicable only to a list or leaf-list."""
raise BadSchemaNodeType(self, "list or leaf-list")
......@@ -470,6 +473,9 @@ class ChoiceNode(InternalNode):
self.default = None # type: NodeName
self.mandatory = False # type: bool
def _tree_line_prefix(self) -> str:
return super()._tree_line_prefix() + ("rw" if self.config else "ro")
def handle_child(self, node: SchemaNode, stmt: SchemaNode,
mid: ModuleId) -> None:
"""Handle a child node to be added to the receiver.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment