IPWorks SSH 2020 Python Edition

Questions / Feedback?

on_transfer Event

Fired during file download/upload.

Syntax

class SCPTransferEventParams(object):
  @property
  def direction() -> int: ...
  @property
  def local_file() -> str: ...
  @property
  def remote_file() -> str: ...
  @property
  def remote_path() -> str: ...
  @property
  def bytes_transferred() -> int: ...
  @property
  def percent_done() -> int: ...
  @property
  def text() -> bytes: ...

# In class SCP:
@property
def on_transfer() -> Callable[[SCPTransferEventParams], None]: ...
@on_transfer.setter
def on_transfer(event_hook: Callable[[SCPTransferEventParams], None]) -> None: ...

Remarks

One or more on_transfer events are fired during file transfer. The BytesTransferred parameter shows the number of bytes transferred since the beginning of the transfer.

Text contains the portion of the file data being delivered.

The Direction parameter shows whether the client (0) or the server (1) is sending the data.

The LocalFile, RemoteFile, and RemotePath parameters provide information about the current transfer.

The PercentDone parameter shows the progress of the transfer in the corresponding direction. If PercentDone can not be calculated the value will be -1.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 Python Edition - Version 20.0 [Build 8501]