armi.utils.pathTools module

This module contains commonly used functions relating to directories, files and path manipulations.

armi.utils.pathTools.getFullFileNames(directory='.', recursive=False)[source]

Returns the fully qualified file names from the specified directory.

armi.utils.pathTools.armiAbsPath(*pathParts)[source]

Convert a list of path components to an absolute path, without drive letters if possible.

This is mostly useful on Windows systems, where drive letters are not well defined across systems. In these cases, it is useful to try to convert to a UNC path if possible.

armi.utils.pathTools.fitPathToFormat(input_path, fmt)[source]

Clean string paths to end with the designated extension

armi.utils.pathTools.viewLocalFiles(fmt)[source]

Show available fmt files in the current directory

armi.utils.pathTools.copyOrWarn(fileDescription, sourcePath, destinationPath)[source]

Copy a file, or warn if the file doesn’t exist.

Parameters
  • fileDescription (str) – a description of the file and/or operation being performed.

  • sourcePath (str) – Path of the file to be copied.

  • destinationPath (str) – Path for the copied file.

armi.utils.pathTools.armiAbsDirFromName(modName)[source]

Convert a module name to a path.

Notes

This is often required in a Cython’d pyd extension where __file__ is otherwise invalid.

armi.utils.pathTools.isFilePathNewer(path1, path2)[source]

Returns true if path1 is newer than path2.

Returns true if path1 is newer than path2, or if path1 exists and path2 does not, otherwise raises an IOError.

armi.utils.pathTools.isAccessible(path)[source]

Check whether user has access to a given path.

Parameters

path (str) – a directory or file