armi.utils.directoryChangers module¶
- class armi.utils.directoryChangers.DirectoryChanger(destination, filesToMove=None, filesToRetrieve=None, dumpOnException=True)[source]¶
Bases:
object
Utility to change directory.
- Parameters
destination (str) – Path of directory to change into
filesToMove (list of str, optional) – Filenames to bring from the CWD into the destination
filesToRetrieve (list of str, optional) – Filenames to bring back from the destination to the cwd
dumpOnException (bool, optional) – Flag to tell system to retrieve the entire directory if an exception is raised within a the context manager.
dir (Use with 'with' statements to execute code in a different) –
clean (guaranteeing a) –
directory (return to the original) –
DirectoryChanger('C (>>> with) –
pass (...) –
Establish the new and return directories
- class armi.utils.directoryChangers.TemporaryDirectoryChanger(root=None, filesToMove=None, filesToRetrieve=None, dumpOnException=True)[source]¶
Bases:
armi.utils.directoryChangers.DirectoryChanger
Create temporary directory, changes into it, and if there is no error/exception generated when using a
with
statement, it deletes the directory.Notes
If there is an error/exception generated while in a
with
statement, the temporary directory contents will be copied to the original directory and then the temporary directory will be deleted.Establish the new and return directories
- class armi.utils.directoryChangers.ForcedCreationDirectoryChanger(destination, filesToMove=None, filesToRetrieve=None, dumpOnException=True)[source]¶
Bases:
armi.utils.directoryChangers.DirectoryChanger
Creates the directory tree necessary to reach your desired destination
Establish the new and return directories