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

Method get_last_entry

AGUI/JSONtreeview.py:259–270  ·  view source on GitHub ↗

Returns the last entry in the TreeView as a dictionary, including nested items.

(self)

Source from the content-addressed store, hash-verified

257
258
259 def get_last_entry(self):
260 """Returns the last entry in the TreeView as a dictionary, including nested items."""
261 children = self.tree.get_children()
262 if children: # Check if there are any items in the TreeView
263 last_item_id = children[-1] # Get the identifier of the last item
264 last_item = self.tree.item(last_item_id)
265 key = last_item['text']
266 # Extract complete data structure under this item
267 full_data = self.extract_treeview_data(last_item_id)
268 return {key: full_data} # Return as a dictionary with key and nested data
269 else:
270 return None # Returns None if the TreeView is empty
271
272 def setup_tags(self, text_widget):
273 """Define tags for JSON highlighting"""

Callers 1

update_viewerMethod · 0.80

Calls 1

extract_treeview_dataMethod · 0.95

Tested by

no test coverage detected