Add default 'None' for onFinished

I don't always need to know whether it was successful.

Contributes to issue CURA-5034.
This commit is contained in:
Ghostkeeper 2018-06-08 14:31:19 +02:00
parent 82a34b49eb
commit 3b510af8f5
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -213,7 +213,14 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
reply.uploadProgress.connect(onProgress)
self._registerOnFinishedCallback(reply, onFinished)
def postFormWithParts(self, target:str, parts: List[QHttpPart], onFinished: Optional[Callable[[Any, QNetworkReply], None]], onProgress: Callable = None) -> None:
## Send an API call to the printer via HTTP POST.
# \param target The target URL on the printer.
# \param parts The parts of a form. One must be provided for each form
# element in the POST call. Create form parts using _createFormPart.
# \param onFinished A function to call when the call has been completed.
# \param onProgress A function to call when progress has been made. Use
# this to update a progress bar.
def postFormWithParts(self, target: str, parts: List[QHttpPart], onFinished: Optional[Callable[[Any, QNetworkReply], None]] = None, onProgress: Callable = None) -> None:
if self._manager is None:
self._createNetworkManager()
request = self._createEmptyRequest(target, content_type=None)