param.resolve_path#

class param.resolve_path(*, path_to_file, search_paths, name)[source]#

Find the path to an existing file, searching the paths specified in the search_paths parameter if the filename is not absolute, and converting a UNIX-style path to the current OS’s format if necessary.

To turn a supplied relative path into an absolute one, the path is appended to paths in the search_paths parameter, in order, until the file is found.

An IOError is raised if the file is not found.

Similar to Python’s os.path.abspath(), except more search paths than just os.getcwd() can be used, and the file must exist.

Parameter Definitions


search_paths = List(bounds=(0, None), default=['/home/runner/work/param/param/doc'], label='Search paths')

Prepended to a non-relative path, in order, until a file is found.

path_to_file = Boolean(allow_None=True, default=True, label='Path to file')

String specifying whether the path refers to a ‘File’ or a ‘Folder’. If None, the path may point to either a ‘File’ or a ‘Folder’.

__init__(**params)[source]#

Methods

__init__(**params)

instance(**params)

Create and return an instance of this class.

Attributes

name

param

path_to_file

search_paths