Replace {key} placeholders in template with values from item.
(template: str, item: dict)
| 24 | |
| 25 | |
| 26 | def _substitute(template: str, item: dict) -> str: |
| 27 | """Replace {key} placeholders in template with values from item.""" |
| 28 | for key, value in item.items(): |
| 29 | template = template.replace(f"{{{key}}}", str(value)) |
| 30 | return template |
| 31 | |
| 32 | |
| 33 | def run_foreach( |