Skip to content

Commit 0ae7f2e

Browse files
committed
Fix variables overrides class methods
1 parent 2a2b10c commit 0ae7f2e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

example_math_nodes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class DataInputNode(BaseNode):
5656

5757
def __init__(self):
5858
super(DataInputNode, self).__init__()
59-
self.output = self.add_output('out')
60-
self.add_text_input('out', 'Data Input', text='0.4', tab='widgets')
59+
self.add_output('out')
60+
self.add_text_input('out', 'Data Output', text='0.4', tab='widgets')
6161
self.view.widgets['out'].value_changed.connect(partial(update_streams, self))
6262

6363
def run(self):
@@ -87,8 +87,8 @@ def __init__(self):
8787
self.view.widgets['functions'].value_changed.connect(self.addFunction)
8888
update = partial(update_streams, self)
8989
self.view.widgets['functions'].value_changed.connect(update)
90-
self.output = self.add_output('output')
91-
self.create_property(self.output.name(), None)
90+
self.add_output('output')
91+
self.create_property('output', None)
9292
self.trigger_type = 'no_inPorts'
9393

9494
self.view.widgets['functions'].widget.setCurrentIndex(2)
@@ -133,9 +133,9 @@ def run(self):
133133

134134
try:
135135
# Execute math function with arguments.
136-
output = self.func(*[self.get_property(inport.name()) for inport in self._inputs if inport.visible()])
136+
data = self.func(*[self.get_property(inport.name()) for inport in self._inputs if inport.visible()])
137137

138-
self.set_property('output', output)
138+
self.set_property('output', data)
139139
except KeyError as error:
140140
print("An input is missing! %s" % str(error))
141141
except TypeError as error:
@@ -158,12 +158,12 @@ class DataViewerNode(BaseNode):
158158

159159
def __init__(self):
160160
super(DataViewerNode, self).__init__()
161-
self.input = self.add_input('in data')
161+
self.inPort = self.add_input('data')
162162
self.add_text_input('data', 'Data Viewer', tab='widgets')
163163

164164
def run(self):
165165
"""Evaluate input to show it."""
166-
for source in self.input.connected_ports():
166+
for source in self.inPort.connected_ports():
167167
from_node = source.node()
168168
try:
169169
from_node.run()

0 commit comments

Comments
 (0)