Working resolver, working recursive logic with dynamic library creation
This commit is contained in:
+15
-15
@@ -1,25 +1,25 @@
|
||||
import json
|
||||
|
||||
def buildSave(outputs, action):
|
||||
save_data = {}
|
||||
def buildSave(action, outputs):
|
||||
if hasattr(action, "savedata"):
|
||||
save_data = {}
|
||||
|
||||
for save_name in action.savedata:
|
||||
save_data[save_name] = outputs[save_name]
|
||||
for save_name in action.savedata:
|
||||
save_data[save_name] = outputs[save_name]
|
||||
|
||||
with open(f"{action.savepath}", "w") as save_file:
|
||||
json.dump(save_data, save_file)
|
||||
with open(f"{action.savepath}", "w") as save_file:
|
||||
json.dump(save_data, save_file)
|
||||
|
||||
#print(f"{save_name} saved by {action.name}")
|
||||
print(f"Data saved by {action.name} to {action.savepath}")
|
||||
print(f"Data saved by {action.name} to {action.savepath}")
|
||||
return outputs
|
||||
|
||||
def loadSave(outputs, action):
|
||||
with open(f"{action.savepath}", "r") as save_file:
|
||||
load_data = json.load(save_file)
|
||||
def loadSave(action, outputs):
|
||||
if hasattr(action, "loaddata"):
|
||||
with open(f"{action.savepath}", "r") as save_file:
|
||||
load_data = json.load(save_file)
|
||||
|
||||
for load_name in action.loaddata:
|
||||
outputs[load_name] = load_data[load_name]
|
||||
#print(f"{load_name} loaded by {action.name}")
|
||||
for load_name in action.loaddata:
|
||||
outputs[load_name] = load_data[load_name]
|
||||
|
||||
print(f"Data loaded by {action.name} from {action.savepath}")
|
||||
print(f"Data loaded by {action.name} from {action.savepath}")
|
||||
return outputs
|
||||
|
||||
Reference in New Issue
Block a user