Make createFormParts public

Because the postFormWithParts function is public and it needs these parts that can (or should) only be created with this function.

Contributes to issue CURA-5034.
This commit is contained in:
Ghostkeeper 2018-06-12 15:44:22 +02:00
parent 2e005a09ac
commit b2cd0ffc0f
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
3 changed files with 6 additions and 6 deletions

View file

@ -217,10 +217,10 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
# If a specific printer was selected, it should be printed with that machine.
if target_printer:
target_printer = self._printer_uuid_to_unique_name_mapping[target_printer]
parts.append(self._createFormPart("name=require_printer_name", bytes(target_printer, "utf-8"), "text/plain"))
parts.append(self.createFormPart("name=require_printer_name", bytes(target_printer, "utf-8"), "text/plain"))
# Add user name to the print_job
parts.append(self._createFormPart("name=owner", bytes(self._getUserName(), "utf-8"), "text/plain"))
parts.append(self.createFormPart("name=owner", bytes(self._getUserName(), "utf-8"), "text/plain"))
file_name = Application.getInstance().getPrintInformation().jobName + "." + preferred_format["extension"]
@ -228,7 +228,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
if isinstance(stream, io.StringIO):
output = output.encode("utf-8")
parts.append(self._createFormPart("name=\"file\"; filename=\"%s\"" % file_name, output))
parts.append(self.createFormPart("name=\"file\"; filename=\"%s\"" % file_name, output))
self._latest_reply_handler = self.postFormWithParts("print_jobs/", parts, onFinished=self._onPostPrintJobFinished, onProgress=self._onUploadPrintJobProgress)