/usr/lib/python2.7/dist-packages/sardana/util/tree.py is in python-sardana 1.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | class BaseNode:
"""BaseNode, stores reference to data."""
def __init__(self, data):
self.data = data
class BranchNode(BaseNode):
"""BranchNode, apart of reference to data, stores a list of
children Nodes."""
def __init__(self, data):
BaseNode.__init__(self, data)
self.children = []
def addChild(self, child):
self.children.append(child)
class LeafNode(BaseNode):
"""LeafMode, just stores reference to data."""
def __init__(self, data):
BaseNode.__init__(self, data)
class Tree:
"""Base tree class, stores reference to root Node object"""
def __init__(self, root):
self._root = root
def root(self):
return self._root
|