def save(self, filename=None):
        """Write config to file."""
        if self.__fname is None and filename is None:
            raise ValueError('Config loaded from string, no filename specified')
        conf = self.__config
        cpa = dict_to_cp(conf)
        with open(self.__fname if filename is None else filename, 'w') as f:
            cpa.write(f)
def save ( self , filename = None ) : if self . __fname is None and filename is None : raise ValueError ( 'Config loaded from string, no filename specified' ) conf = self . __config cpa = dict_to_cp ( conf ) with open ( self . __fname if filename is None else filename , 'w' ) as f : cpa . write ( f )
Write config to file.