INNER CODE UNIT · Python

load_config

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

def load_config(opts):
    print("Loading template...")
    with open(opts.template_file, 'r') as stream:
        try:
            opts.template = yaml.safe_load(stream)
            for section in opts.template["sections"]:
                if type(section) is dict:
                    section["items"] = []
        except yaml.YAMLError as e:
            print('Cannot load template file:', e)


def mapPullRequest(pullRequest, opts):
    title = pullRequest["title"].encode('ascii', 'backslashreplace').decode().replace("<", "\<")
    for regex in opts.template["autoformat"]:
        title = re.sub(regex["match"], regex["replace"], title)

    return {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…