mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
0bf862f9a9
2 changed files with 11 additions and 4 deletions
|
@ -720,9 +720,12 @@ class CuraEngineBackend(QObject, Backend):
|
|||
## Creates a new socket connection.
|
||||
def _createSocket(self, protocol_file: str = None) -> None:
|
||||
if not protocol_file:
|
||||
if not self.getPluginId():
|
||||
Logger.error("Can't create socket before CuraEngineBackend plug-in is registered.")
|
||||
return
|
||||
plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId())
|
||||
if not plugin_path:
|
||||
Logger.log("e", "Could not get plugin path!", self.getPluginId())
|
||||
Logger.error("Could not get plugin path!", self.getPluginId())
|
||||
return
|
||||
protocol_file = os.path.abspath(os.path.join(plugin_path, "Cura.proto"))
|
||||
super()._createSocket(protocol_file)
|
||||
|
|
|
@ -92,9 +92,13 @@ class SendMaterialJob(Job):
|
|||
parts = []
|
||||
|
||||
# Add the material file.
|
||||
with open(file_path, "rb") as f:
|
||||
parts.append(self.device.createFormPart("name=\"file\"; filename=\"{file_name}\""
|
||||
.format(file_name = file_name), f.read()))
|
||||
try:
|
||||
with open(file_path, "rb") as f:
|
||||
parts.append(self.device.createFormPart("name=\"file\"; filename=\"{file_name}\""
|
||||
.format(file_name = file_name), f.read()))
|
||||
except FileNotFoundError:
|
||||
Logger.error("Unable to send material {material_id}, since it has been deleted in the meanwhile.".format(material_id = material_id))
|
||||
return
|
||||
|
||||
# Add the material signature file if needed.
|
||||
signature_file_path = "{}.sig".format(file_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue