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

@ -83,12 +83,12 @@ class SendMaterialJob(Job):
parts = []
with open(file_path, "rb") as f:
parts.append(self.device._createFormPart("name=\"file\"; filename=\"{file_name}\"".format(file_name = file_name), f.read()))
parts.append(self.device.createFormPart("name=\"file\"; filename=\"{file_name}\"".format(file_name = file_name), f.read()))
signature_file_path = file_path + ".sig"
if os.path.exists(signature_file_path):
_, signature_file_name = os.path.split(signature_file_path)
with open(signature_file_path, "rb") as f:
parts.append(self.device._createFormPart("name=\"signature_file\"; filename=\"{file_name}\"".format(file_name = signature_file_name), f.read()))
parts.append(self.device.createFormPart("name=\"signature_file\"; filename=\"{file_name}\"".format(file_name = signature_file_name), f.read()))
Logger.log("d", "Syncing material {material_id} with cluster.".format(material_id = material_id))
self.device.postFormWithParts(target = "materials/", parts = parts, onFinished = self.sendingFinished)