Module modules.misc.cli

Functions

def file_path(path: str)
Expand source code
def file_path(path: str):
    """Verifies that the argument is a valid file path."""

    if os.path.isfile(path) or os.access(os.path.dirname(path), os.W_OK):
        return path
    else:
        raise FileNotFoundError(f"{path} is not a valid file path.")

Verifies that the argument is a valid file path.