The download.py
module#
Summary#
Download a file from the server to the localhost. |
|
Download logs from the server to the localhost. |
|
Handle server response. |
Description#
Provides a function for downloading files from the server to the client.
Module detail#
- download.download_file(stub: ansys.api.additive.v0.additive_simulation_pb2_grpc.SimulationServiceStub, remote_file_name: str, local_folder: str, progress_handler: ansys.additive.core.progress_handler.IProgressHandler = None) str #
Download a file from the server to the localhost.
- Parameters:
- stub: SimulationServiceStub
gRPC stub for the simulation service.
- remote_file_name: str
Path to file on the server.
- local_folder: str
Folder on your localhost to write your file to.
- progress_handler: ProgressLogger, None, default: None
Progress update handler. If
None
, no progress will be provided.
- Returns:
str
Local path of downloaded file.
- download.download_logs(stub: ansys.api.additive.v0.additive_simulation_pb2_grpc.SimulationServiceStub, local_folder: str, progress_handler: ansys.additive.core.progress_handler.IProgressHandler = None) str #
Download logs from the server to the localhost.
- Parameters:
- stub: SimulationServiceStub
gRPC stub for the simulation service.
- local_folder: str
Folder on your localhost to write the server logs to.
- progress_handler: ProgressLogger, None, default: None
Progress update handler. If
None
, no progress will be provided.
- Returns:
str
Local path of downloaded file.
- download.handle_download_file_response(destination: str, download_file_response: any, progress_handler: ansys.additive.core.progress_handler.IProgressHandler = None) None #
Handle server response.
- Parameters:
- destination: str
Destination of the file.
- download_file_response: any
Download file response.
- progress_handler: IProgressHandler, default: None
Progress handler.