import re


def dict_from_sdkconfig(path):
    """
    Parse the sdkconfig file at 'path', return name:value pairs as a dict
    """
    regex = re.compile(r"^([^#=]+)=(.+)$")
    result = {}
    with open(path) as f:
        for line in f:
            m = regex.match(line)
            if m:
                result[m.group(1)] = m.group(2)
    return result