Add PRESS_ENTER action type to extract-action prompt (#SKY-7792) (#4669)

This commit is contained in:
pedrohsdb
2026-02-09 11:46:12 -08:00
committed by GitHub
parent 7e6dfcc6d1
commit 226288445d
5 changed files with 60 additions and 3 deletions

View File

@@ -634,6 +634,39 @@ def _action_to_stmt(act: dict[str, Any], task: dict[str, Any], assign_to_output:
),
)
)
elif method == "keypress":
args.append(
cst.Arg(
keyword=cst.Name("keys"),
value=_value(act.get("keys", ["Enter"])),
whitespace_after_arg=cst.ParenthesizedWhitespace(
indent=True,
last_line=cst.SimpleWhitespace(INDENT),
),
)
)
if act.get("hold"):
args.append(
cst.Arg(
keyword=cst.Name("hold"),
value=_value(act["hold"]),
whitespace_after_arg=cst.ParenthesizedWhitespace(
indent=True,
last_line=cst.SimpleWhitespace(INDENT),
),
)
)
if act.get("duration"):
args.append(
cst.Arg(
keyword=cst.Name("duration"),
value=_value(act["duration"]),
whitespace_after_arg=cst.ParenthesizedWhitespace(
indent=True,
last_line=cst.SimpleWhitespace(INDENT),
),
)
)
elif method == "wait":
args.append(
cst.Arg(