Skip to content

Commit a6f4d89

Browse files
committed
solver issue #142
1 parent 75dc9f1 commit a6f4d89

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

NodeGraphQt/base/model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,14 @@ def to_dict(self):
236236
if custom_props:
237237
# exclude the data which can not be serialed (like numpy array)
238238
to_remove = []
239-
types = [float, str, int, list, dict, bool, None, complex]
239+
types = [float, str, int, list, dict, bool, None, complex, tuple]
240240
for k, v in custom_props.items():
241241
if type(v) not in types:
242242
try:
243243
json.dumps(v)
244244
except:
245245
to_remove.append(k)
246-
for k in to_remove:
247-
custom_props.pop(k)
246+
[custom_props.pop(k) for k in to_remove]
248247

249248
node_dict['custom'] = custom_props
250249

NodeGraphQt/widgets/actions.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ def __init__(self, *args, **kwargs):
99
super(BaseMenu, self).__init__(*args, **kwargs)
1010
self.setStyleSheet(STYLE_QMENU)
1111

12-
def hideEvent(self, event):
13-
super(BaseMenu, self).hideEvent(event)
14-
for a in self.actions():
15-
if hasattr(a, 'node_id'):
16-
a.node_id = None
12+
# disable for issue #142
13+
# def hideEvent(self, event):
14+
# super(BaseMenu, self).hideEvent(event)
15+
# for a in self.actions():
16+
# if hasattr(a, 'node_id'):
17+
# a.node_id = None
1718

1819
def get_menu(self, name):
1920
for action in self.actions():
@@ -50,8 +51,3 @@ def __init__(self, *args, **kwargs):
5051
def _on_triggered(self):
5152
node = self.graph.get_node_by_id(self.node_id)
5253
self.executed.emit(self.graph, node)
53-
54-
def get_action(self, name):
55-
for action in self.qmenu.actions():
56-
if not action.menu() and action.text() == name:
57-
return action

NodeGraphQt/widgets/viewer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ def __init__(self, parent=None):
8686
self._ctx_menu = BaseMenu('NodeGraph', self)
8787
self._ctx_node_menu = BaseMenu('Nodes', self)
8888
menu_bar.addMenu(self._ctx_menu)
89-
menu_bar.addMenu(self._ctx_node_menu)
90-
91-
self._ctx_node_menu.setDisabled(True)
89+
# menu_bar.addMenu(self._ctx_node_menu)
90+
# self._ctx_node_menu.setDisabled(True)
9291

9392
self.acyclic = True
9493
self.LMB_state = False

example_auto_nodes/node_base/module_node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def _get_functions_from_module(module, function_dict, max_depth=1, module_name=N
2323
function_dict[new_module_name] = obj
2424

2525

26-
def get_functions_from_module(module, max_depth=1, module_name=None):
26+
def get_functions_from_module(module, max_depth=1):
2727
function_dict = {}
28-
_get_functions_from_module(module, function_dict, max_depth, module_name)
28+
_get_functions_from_module(module, function_dict, max_depth)
2929
return function_dict
3030

3131

@@ -124,7 +124,7 @@ def run(self):
124124
return self.defaultValue
125125

126126
try:
127-
# Execute math function with arguments.
127+
# Execute function with arguments.
128128
if self.is_function(self.func):
129129
data = self.func(*args)
130130
else:

0 commit comments

Comments
 (0)