fileloc¶
-
tollan.utils.fileloc(loc, local_parent_path=None, remote_parent_path=None)[source]¶ Return a
FileLocobject.- Parameters
- locstr,
Path, tuple,FileLoc The location of the file, composed of the hostname and the path. It can take the form of the follows:
str. In this case,locis interpreted as a local path, or a remote path similar to sftp syntax:<hostname>:<abspath>. A remote relative path is not supported.Path. It is a local path.Tuple of
(<hostname>, <abspath>). It is a remote path, unlesshostnameis “localhost”. A remote relative path is not supported.FileLoc. It is returned unaltered.
- local_parent_pathstr,
Path, None If not None, this is used as the parent of local relative path. Otherwise, the current path (
pwd) is used. Ignored iflocisFileLoc.- remote_parent_pathstr,
Path, None If not None and is absolute, this is used as the parent of remote relative path. Otherwise,
ValueErrorwill be raised if a remote relative path is given. Ignored iflocisFileLoc.
- locstr,