(self)
| 163 | pass |
| 164 | |
| 165 | def paste_json(self): |
| 166 | selected_item = self.tree.selection()[0] if self.tree.selection() else '' |
| 167 | input_json = self.root.clipboard_get() |
| 168 | try: |
| 169 | json_data = json.loads(input_json) |
| 170 | if json_data: |
| 171 | if selected_item: |
| 172 | # Insert the JSON data as a child of the selected item |
| 173 | self.insert_json(selected_item, json_data) |
| 174 | else: |
| 175 | # If no item is selected, insert at the root |
| 176 | self.insert_json('', json_data) |
| 177 | except json.JSONDecodeError: |
| 178 | messagebox.showerror("Error", "Invalid JSON") |
| 179 | except Exception as e: |
| 180 | messagebox.showerror("Error", f"An error occurred: {str(e)}") |
| 181 | |
| 182 | def clear_all(self): |
| 183 | """Clears all the nodes in the tree.""" |
nothing calls this directly
no test coverage detected