def removeLayout(name): """Deletes the named layout. """ log.debug('Deleting layout with name {}'.format(name)) fslsettings.delete('fsleyes.layouts.{}'.format(name)) fslsettings.delete('fsleyes.perspectives.{}'.format(name)) _removeFromLayoutList(name)
def test_initialise(): # Assuming that initialise() # has not yet been called assert settings.read('nothing') is None assert settings.read('nothing', 'default') == 'default' settings.write('nothing', 'nothing') settings.delete('nothing') assert settings.readFile('nothing') is None settings.writeFile('nothing', 'nothing') settings.deleteFile('nothing') assert settings.filePath() is None assert settings.readAll() == {} assert settings.listFiles() == [] settings.clear() with tests.testdir() as testdir: settings.initialise(cfgid='test', cfgdir=testdir, writeOnExit=False) assert settings.settings.configID == 'test' assert settings.settings.configDir == testdir settings.write('setting', 'value') assert settings.read('setting') == 'value' assert settings.read('nothing') is None
def shutdown(): """Called when FSLeyes exits normally (i.e. the user closes the window). Does some final clean-up before exiting. """ import fsl.utils.settings as fslsettings # Clear the cached directory for loading/saving # files - when FSLeyes starts up, we want it to # default to the current directory. fslsettings.delete('loadSaveOverlayDir')
def removePerspective(name): """Deletes the named perspective. """ log.debug('Deleting perspective with name {}'.format(name)) fslsettings.delete('fsleyes.perspectives.{}'.format(name)) _removeFromPerspectivesList(name)