diff --git a/python/pyrogue/_Node.py b/python/pyrogue/_Node.py index 6a4576258..3395656a4 100644 --- a/python/pyrogue/_Node.py +++ b/python/pyrogue/_Node.py @@ -154,6 +154,7 @@ class Node(object): ------- """ + _nodeCount = 0 def __init__(self, *, name, description="", expand=True, hidden=False, groups=None, guiGroup=None): """ @@ -183,6 +184,7 @@ def __init__(self, *, name, description="", expand=True, hidden=False, groups=No ------- """ + pr.Node._nodeCount += 1 # Public attributes self._name = name @@ -213,6 +215,10 @@ def __init__(self, *, name, description="", expand=True, hidden=False, groups=No def __repr__(self): return f'{self.__class__} - {self.path}' + @property + def nodeCount(self): + return pr.Node._nodeCount + @property def name(self): """ @@ -559,7 +565,7 @@ def addNodes(self, nodeClass, number, stride, **kwargs): def nodeList(self): """Get a recursive list of nodes.""" lst = [] - for key,value in self.nodes.items(): + for key,value in self._nodes.items(): lst.append(value) lst.extend(value.nodeList) return lst