Swibots have a number of built-in functions that can be used in the code of your Swibot. These functions are available in the swibot module.
A callback function that is called when the download progress changes.
DownloadProgressCallback = Callable[[DownloadProgress], Coroutine[Any, Any, None]]
progress(DownloadProgress): The download progress
The download progress.
downloaded(int): The number of bytes that have been downloadedtotal(int): The total number of bytes to downloadurl(str): The URL of the file being downloadedclient(IOClient): The client that is downloading the filefile_name(str): The file name of the file being downloadedstared(bool): Whether the download has started
A callback function that is called when the upload progress changes.
UploadProgressCallback = Callable[[UploadProgress], Coroutine[Any, Any, None]]
progress(UploadProgress): The upload progress
The upload progress.
current(int): The current chunk size (in bytes) being uploadedreaded(int): The number of bytes that have been uploadedurl(str): The URL of the file being uploadedclient(IOClient): The client that is uploading the filefile_name(str): The file name of the file being uploadedstarted(bool): Whether the upload has startedcallback(UploadProgressCallback): The callback function that is called when the upload progress changescallback_args(tuple): Additional arguments to pass to thecallbackcallback function
The client that is used to download files. This is a class with just one metod cancel(), which can be used to cancel the download / upload.
It is used as a property of the DownloadProgress and UploadProgress objects.