latools/helpers/config.py
def change_default(config):
    """
    Change the default configuration.
    """
    config_file, cf = read_latoolscfg()

    if config not in cf.sections():
        raise ValueError("\n'{:s}' is not a defined configuration.".format(config))

    if config == 'REPRODUCE':
        pstr = ('Are you SURE you want to set REPRODUCE as your default configuration?\n' + 
                '     ... this is an odd thing to be doing.')
    else:
        pstr = ('Are you sure you want to change the default configuration from {:s}'.format(cf['DEFAULT']['config']) + 
                'to {:s}?'.format(config))

    response = input(pstr + '\n> [N/y]: ')

    if response.lower() == 'y':
        cf.set('DEFAULT', 'config', config)
        with open(config_file, 'w') as f:
            cf.write(f)
        print('  Default changed!')
    else:
        print('  Done nothing.')
def change_default(config):
    config_file, cf = read_latoolscfg()

    if config not in cf.sections():
        raise ValueError("\n'{:s}' is not a defined configuration.".format(config))

    if config == 'REPRODUCE':
        pstr = ('Are you SURE you want to set REPRODUCE as your default configuration?\n' + 
                '     ... this is an odd thing to be doing.')
    else:
        pstr = ('Are you sure you want to change the default configuration from {:s}'.format(cf['DEFAULT']['config']) + 
                'to {:s}?'.format(config))

    response = input(pstr + '\n> [N/y]: ')

    if response.lower() == 'y':
        cf.set('DEFAULT', 'config', config)
        with open(config_file, 'w') as f:
            cf.write(f)
        print('  Default changed!')
    else:
        print('  Done nothing.')
def change_default ( config ) : config_file , cf = read_latoolscfg ( ) if config not in cf . sections ( ) : raise ValueError ( "\n'{:s}' is not a defined configuration." . format ( config ) ) if config == 'REPRODUCE' : pstr = ( 'Are you SURE you want to set REPRODUCE as your default configuration?\n' + '     ... this is an odd thing to be doing.' ) else : pstr = ( 'Are you sure you want to change the default configuration from {:s}' . format ( cf [ 'DEFAULT' ] [ 'config' ] ) + 'to {:s}?' . format ( config ) ) response = input ( pstr + '\n> [N/y]: ' ) if response . lower ( ) == 'y' : cf . set ( 'DEFAULT' , 'config' , config ) with open ( config_file , 'w' ) as f : cf . write ( f ) print ( '  Default changed!' ) else : print ( '  Done nothing.' )
Change the default configuration.
Change the default configuration .