def __init__(self, yamlfilename=None, writable=True, **kwargs):


        super(YAMLFile, self).__init__(**kwargs)
        if yamlfilename == None and 'parent' in kwargs and hasattr(kwargs['parent'], 'yamlfilename'):
            yamlfilename = kwargs['parent'].yamlfilename
        if 'defaults' in kwargs:
            self.source = kwargs['defaults']
        else:
            with codecs.open(yamlfilename, encoding="utf-8") as fp:
                # do we need safe_load?
                self.source = yaml.safe_load(fp.read())
            self.yamlfilename = yamlfilename
            self.dirty = False
        self.writable = writable
        self.encoding = "utf-8"  # not sure this is ever really needed
Loads and optionally saves configuration files in YAML
dataset/ETHPy150Open staffanm/layeredconfig/layeredconfig/yamlfile.py/YAMLFile.__init__