transfer
¶
The TransferPlus
class is a subclass of the Transfer
class from the
fabric
library.
As such, the behavior is (almost) identical to the Transfer
class from Fabric.
To see those behaviors, please refer to the Fabric documentation.
- class fabricplus.transfer.TransferPlus(connection: Conn)¶
TransferPlus is a subclass of the base fabric Transfer object, overloading the parent object to provide additional functionality for SCP transfers.
- __init__(connection: Conn) None ¶
Initializes the TransferPlus object.
- Parameters:
connection – A fabric Connection-like object.
- get(*args, **kwargs) None ¶
Get a file from the remote host.
- Parameters:
remote_path – The path to the file on the remote host.
local_path – The path to save the file locally. Defaults to current working dir.
scp – If the transfer should be done via SCP. Defaults to False or the Connection value.
recursive – If the transfer should be recursive. Defaults to False.
preserve_times – If the file times should be preserved. Defaults to False.
- Returns:
None
- Return type:
None
- put(*args, **kwargs) None ¶
Put a file on the remote host.
- Parameters:
local_path – The path to the file on the local host.
remote_path – The path to save the file remotely. Defaults to current working dir for the session.
scp – If the transfer should be done via SCP. Defaults to False or the Connection value.
recursive – If the transfer should be recursive. Defaults to False.
preserve_times – If the file times should be preserved. Defaults to False.
- Returns:
None
- Return type:
None
- property scp: SCPClient¶
Returns an SCP client object for the connection.
- Raises:
AttributeError – If the base fabric Connection object does not have an SCP client.
- Returns:
An SCP client object.
- Return type:
scp.SCPClient