loam/manager.py
def create_config_(self, index=0, update=False):
        """Create config file.

        Create config file in :attr:`config_files_[index]`.

        Parameters:
            index(int): index of config file.
            update (bool): if set to True and :attr:`config_files_` already
                exists, its content is read and all the options it sets are
                kept in the produced config file.
        """
        if not self.config_files_[index:]:
            return
        path = self.config_files_[index]
        if not path.parent.exists():
            path.parent.mkdir(parents=True)
        conf_dict = {}
        for section in self.sections_():
            conf_opts = [o for o, m in self[section].defaults_() if m.conf_arg]
            if not conf_opts:
                continue
            conf_dict[section] = {}
            for opt in conf_opts:
                conf_dict[section][opt] = (self[section][opt] if update else
                                           self[section].def_[opt].default)
        with path.open('w') as cfile:
            toml.dump(conf_dict, cfile)
def create_config_(self, index=0, update=False):
        if not self.config_files_[index:]:
            return
        path = self.config_files_[index]
        if not path.parent.exists():
            path.parent.mkdir(parents=True)
        conf_dict = {}
        for section in self.sections_():
            conf_opts = [o for o, m in self[section].defaults_() if m.conf_arg]
            if not conf_opts:
                continue
            conf_dict[section] = {}
            for opt in conf_opts:
                conf_dict[section][opt] = (self[section][opt] if update else
                                           self[section].def_[opt].default)
        with path.open('w') as cfile:
            toml.dump(conf_dict, cfile)
def create_config_ ( self , index = 0 , update = False ) : if not self . config_files_ [ index : ] : return path = self . config_files_ [ index ] if not path . parent . exists ( ) : path . parent . mkdir ( parents = True ) conf_dict = { } for section in self . sections_ ( ) : conf_opts = [ o for o , m in self [ section ] . defaults_ ( ) if m . conf_arg ] if not conf_opts : continue conf_dict [ section ] = { } for opt in conf_opts : conf_dict [ section ] [ opt ] = ( self [ section ] [ opt ] if update else self [ section ] . def_ [ opt ] . default ) with path . open ( 'w' ) as cfile : toml . dump ( conf_dict , cfile )
Create config file.

        Create config file in :attr:`config_files_[index]`.

        Parameters:
            index(int): index of config file.
            update (bool): if set to True and :attr:`config_files_` already
                exists, its content is read and all the options it sets are
                kept in the produced config file.
Create config file .