MCPcopy Create free account
hub / github.com/Bleemsys/Artisan-Core / node_to_dict

Method node_to_dict

AGUI/JSONtreeview.py:202–217  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

200
201 def extract_treeview_data(self, node_id=''):
202 def node_to_dict(item):
203 children = self.tree.get_children(item)
204 if not children:
205 # If the node has no children, return the value
206 values = self.tree.item(item, 'values')
207
208 re_val = self.parse_treeview_value(values[0])
209
210 return re_val if values else None
211 else:
212 # If the node has children, create a dictionary
213 node_dict = {}
214 for child in children:
215 child_key = self.tree.item(child, 'text')
216 node_dict[child_key] = node_to_dict(child)
217 return node_dict
218
219 reconstructed_data = {}
220 root_nodes = self.tree.get_children(node_id)

Callers

nothing calls this directly

Calls 1

parse_treeview_valueMethod · 0.95

Tested by

no test coverage detected