INNER CODE UNIT · Python

apply_template

mongodb/mongo-csharp-driver · evergreen/release-notes.py:120

def apply_template(template, parameters):
    return re.sub(r'\$\{([\w.]+)}', lambda m: get_field(parameters, m.group(1)), template)


def process_section(section):
    if type(section) is str:
        return apply_template(section, options)
    if len(section["items"]) == 0:
        return ""

    content = ""
    title = section.get("title", "")
    if title != "":
        content = apply_template(title, options) + '\n'

    for pullrequest in section["items"]:
        content = content + '\n - ' + pullrequest["title"]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…