def apply_config(filename): from tuna.config import Config config = Config() if os.path.exists(filename): config.config['root'] = os.getcwd() + "/" filename = os.path.basename(filename) else: if not os.path.exists(config.config['root']+filename): print filename + _(" not found!") exit(-1) if config.loadTuna(filename): exit(1) ctrl = 0 values = {} values['toapply'] = {} for index in range(len(config.ctlParams)): for opt in config.ctlParams[index]: values['toapply'][ctrl] = {} values['toapply'][ctrl]['label'] = opt values['toapply'][ctrl]['value'] = config.ctlParams[index][opt] ctrl = ctrl + 1 config.applyChanges(values)