Skip to main content

raygeo.fstring

Functions

parse_include_directive()

parse_include_directive(line: str) -> str | None

Parse an @include(MacroName) directive.

Returns the macro name (stripped of whitespace) or None if the line is not an include directive.

ParameterTypeDescription
linestr
Returnsstr | None

render_named()

render_named(template: str, vars: dict[str, str]) -> str

Resolve named substitution variables in a template string.

Replaces {name} placeholders using the provided dict. Unknown placeholders (including path-style {machine.name}) are left verbatim for a subsequent resolve_path_vars call.

ParameterTypeDescription
templatestr
varsdict[str, str]
Returnsstr

resolve_path_vars()

resolve_path_vars(template: str, path_vars: dict[str, str]) -> str

Resolve path-style placeholders using a flat dict.

Replaces {machine.name}, {job.extents[0]} etc. using the provided dict. Unresolved placeholders are left verbatim.

ParameterTypeDescription
templatestr
path_varsdict[str, str]
Returnsstr