Improved recursive handling by nesting operations in operations under then new buildRecursive. Also changed extract module to attach its findings to outputs for better resolver and recursiveSet targeting.

This commit is contained in:
Lyncoln
2026-10-24 21:03:03 -04:00
parent ad80289675
commit 7b949ec004
11 changed files with 308 additions and 11 deletions
+9
View File
@@ -23,6 +23,8 @@ def buildRecursive(definition, outputs):
source = definition.recursiveset["source"]
items = outputs.get(source)
#print(f"RECURSIVE DEBUG DURING {definition.name}")
#print(items)
if items is None:
print(f"No items available in {source} for {definition.name}")
@@ -38,8 +40,15 @@ def buildRecursive(definition, outputs):
outputs[definition.recursiveset["outputlabel"]] = item
for job in recursiveset:
#print(f"RECURSIVE DEBUG DURING {job.name}")
#print(item)
#outputs, response = buildAction(job, outputs)
outputs, response = executeContract(job, outputs)
responses.append(response)
retain = definition.recursiveset.get("retain", True)
if not retain:
outputs.pop(source, None)
return outputs, responses
+5 -7
View File
@@ -2,6 +2,8 @@ def resolveItem(action, item):
resolved = {}
if hasattr(action, "resolve"):
for label, keys in action.resolve["get"].items():
#print("RESOLVER DEBUG")
#print(item)
target = item
try:
for key in keys:
@@ -94,12 +96,6 @@ def extractItem(action, item, resolved):
target = item
try:
for key in keys:
#if isinstance(target, dict):
#.get not compatible with resolving through lists
#target = target.get(key)
#if isinstance(target, list):
#regular key not compatible with resolving potentially unknown values like upload image
target = target[key]
except (KeyError, IndexError) as error:
@@ -108,7 +104,9 @@ def extractItem(action, item, resolved):
print("EXTRACT MODULE TEST")
print(target)
resolved[label] = target
item[label] = target
if "construct" in action.extract:
for label2, piece in action.extract["construct"].items():
constructed = ""