Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_parent(self):
"""Provide TreeNode with a parent for the current node. This function
is only required if the tree was instantiated from a child node
(virtual function)"""
raise TreeWidgetError("virtual function. Implement in subclass")
def load_child_keys(self):
"""Provide ParentNode with an ordered list of child keys (virtual
function)"""
raise TreeWidgetError("virtual function. Implement in subclass")
def load_child_node(self, key):
"""Load the child node for a given key (virtual function)"""
raise TreeWidgetError("virtual function. Implement in subclass")
def get_child_index(self, key):
try:
return self.get_child_keys().index(key)
except ValueError:
errorstring = ("Can't find key %s in ParentNode %s\n" +
"ParentNode items: %s")
raise TreeWidgetError(errorstring % (key, self.get_key(),
str(self.get_child_keys())))