(self)
return result
Unbuilds, stringifies and saves the config. If the config was loaded from string, returns ``{ origin: data }`` dict
Unbuilds, stringifies and saves the config. If the config was loaded from string, returns ``{ origin: data }`` dict
Unbuilds stringifies and saves the config . If the config was loaded from string returns { origin : data } dict
def save(self):
        """
        Unbuilds, stringifies and saves the config. If the config was loaded from string, returns ``{ origin: data }`` dict
        """
        tree = self.tree
        if self.builder is not None:
            nodetree = self.builder.unbuild(tree) or self.nodetree
        if self.includer is not None:
            nodetree = self.includer.decompose(nodetree)
        else:
            nodetree = {self.origin: nodetree}

        result = {}
        for k in nodetree:
            v = self.parser.stringify(nodetree[k])
            if self.encoding != 'utf8':
                v = v.encode(self.encoding)
            result[k or self.origin] = v

        if self.origin is not None:
            for k in result:
                open(k, 'w').write(result[k])
        return result
def save ( self ) : tree = self . tree if self . builder is not None : nodetree = self . builder . unbuild ( tree ) or self . nodetree if self . includer is not None : nodetree = self . includer . decompose ( nodetree ) else : nodetree = { self . origin : nodetree } result = { } for k in nodetree : v = self . parser . stringify ( nodetree [ k ] ) if self . encoding != 'utf8' : v = v . encode ( self . encoding ) result [ k or self . origin ] = v if self . origin is not None : for k in result : open ( k , 'w' ) . write ( result [ k ] ) return result