MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / __init__

Method __init__

tools/scripts/massif-diff.py:103–117  ·  view source on GitHub ↗
(self, orig_level=0, parent=None, text=None, copy=None)

Source from the content-addressed store, hash-verified

101
102class Node:
103 def __init__(self, orig_level=0, parent=None, text=None, copy=None):
104 self.orig_level = orig_level if copy is None else copy.orig_level
105 self.parent = parent if copy is None else copy.parent
106 self.text = text if copy is None else copy.text
107 # TBD: This dict copy takes up good chunk of time and memory and
108 # probably isn't always necessary, but replacing this with a simple
109 # copy on write wrapper used up more space.
110 self.props = {} if copy is None else copy.props.copy()
111 self.total = 0 if copy is None else copy.total
112 self.value = None if copy is None else copy.value
113
114 self.nodes = []
115 if copy is not None:
116 for node in copy.nodes:
117 self.nodes.append(Node(copy=node))
118
119 def is_root(self):
120 return self.orig_level == 0

Callers

nothing calls this directly

Calls 3

NodeClass · 0.70
copyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected