RemotePath

class hep_rfm.RemotePath(path, path_checker=None)[source]

Bases: hep_rfm.protocols.ProtocolPath

Represent a remote path. This is an abstract class, any class inheriting from it must override the following methods: 1. ProtocolPath.copy() 2. RemotePath.join_path() (must be decorated with staticmethod()) 4. ProtocolPath.mkdirs() 5. RemotePath.split_path()

Parameters:
  • path (str) – path to save, pointing to a file.
  • path_checker (function) – possible function that checks the the given path actually corresponds to the protocol. It must take a path as argument and return a bool.
Raises:

ValueError – if the path does not satisfy the requirements from “path_checker”.

Methods Summary

join_path(prefix, path) Policy to merge a prefix and a path in this protocol.
split_path() Split the remote path in the server specifications and path in the server.

Methods Documentation

static join_path(prefix, path)[source]

Policy to merge a prefix and a path in this protocol. In this case, this is an abstract method.

Parameters:
  • prefix (str) – prefix to add to the current path.
  • path (str) – path to the file in the remote.
Returns:

result of joining the prefix and the path for this protocol.

Return type:

str

split_path()[source]

Split the remote path in the server specifications and path in the server. In this case, this is an abstract method.