Files
clientCommands/src/greeting/template.py
T
exteraGramPlugins 787965ebbf Initial commit
2026-10-09 12:25:06 +00:00

14 lines
331 B
Python

from textutil import normalize
class TemplateError(ValueError):
pass
def render(template: str, name: str) -> str:
normalized = normalize(name)
try:
return template.format(name=normalized)
except (KeyError, IndexError, ValueError):
raise TemplateError(f"unsupported placeholder in {template!r}")