Browse Source

Add default 'None' for onFinished

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

Contributes to issue CURA-5034.
Ghostkeeper 6 years ago
parent
commit
3b510af8f5
1 changed files with 8 additions and 1 deletions
  1. 8 1
      cura/PrinterOutput/NetworkedPrinterOutputDevice.py

+ 8 - 1
cura/PrinterOutput/NetworkedPrinterOutputDevice.py

@@ -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)