INNER CODE UNIT · Python
launch_allows_handoff
WMAL/kodachios · Kodachi-OS-10-stable/open/dock/lib/kodachi_direct.py:529
def launch_allows_handoff(self, key):
policy = self.operation(key)["executionPolicy"]["launchHandoffPolicy"]
if not policy["launch"]:
raise DirectContractError(
"the generated operation is not declared as a launcher")
return policy["handoff"]
def preview(self, key, parameters=None):
bindings = self.bindings(key)
values = dict(parameters or {})
allowed = {item["name"] for binding in bindings
for item in binding["parameters"]}
unexpected = sorted(set(values) - allowed)
if unexpected:
raise DirectContractError(
"unexpected typed parameter(s): " + ", ".join(unexpected))
commands = []
for binding in bindings: