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

Method LoadFromFile

AGUI/DFEditor.py:95–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 self.editor_gui.title("ArtGUI Definition Editior "+self.sessionfile)
94
95 def LoadFromFile(self):
96 file_path = filedialog.askopenfilename(filetypes=[(self.fileext+" files", "*."+self.fileext), ("All files", "*.*")])
97
98 if file_path:
99 try:
100 with open(file_path, 'r') as file:
101 self.data = json.load(file)
102 self.clear_all()
103 self.insert_json("", self.data)
104
105 self.sessionfile = file_path
106 self.editor_gui.title("ArtGUI Definition Editior "+self.sessionfile)
107
108 except Exception as e:
109 tk.messagebox.showerror("Error", f"Failed to load JSON file:\n{e}")
110
111
112

Callers

nothing calls this directly

Calls 2

clear_allMethod · 0.80
insert_jsonMethod · 0.80

Tested by

no test coverage detected