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

Method insert_json

AGUI/JSONtreeview.py:74–88  ·  view source on GitHub ↗
(self, parent, json_dict)

Source from the content-addressed store, hash-verified

72 widget.bind("<Leave>", lambda _: tooltip.hide_tip())
73
74 def insert_json(self, parent, json_dict):
75 for key, value in json_dict.items():
76 if isinstance(value, dict):
77 # Insert dictionary nodes recursively
78 node = self.tree.insert(parent, 'end', text=key, values=[{}])
79 self.insert_json(node, value)
80 elif isinstance(value, list):
81 # Insert lists directly without further filtering
82 node = self.tree.insert(parent, 'end', text=key, values=[json.dumps(value)])
83 elif isinstance(value, (int, float, bool)):
84 # Insert numbers and booleans directly
85 self.tree.insert(parent, 'end', text=key, values=[value])
86 else:
87 # Insert strings directly
88 self.tree.insert(parent, 'end', text=key, values=[value])
89
90 def item_clicked(self, event):
91 item_id = self.tree.focus()

Callers 8

__init__Method · 0.95
save_changesMethod · 0.95
paste_jsonMethod · 0.95
AddJSONtoTreeViewMethod · 0.80
load_configurationFunction · 0.80
__init__Method · 0.80
LoadFromFileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected