Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Prado Gesto <d.pradogesto@ultimaker.com>2018-08-03 13:02:11 +0300
committerDiego Prado Gesto <d.pradogesto@ultimaker.com>2018-08-03 13:02:11 +0300
commit38a0c9b66de36f46390b42834f595557a56d1df0 (patch)
treee877de6dceedc746423590b3f38807a03c94ae70 /plugins/GCodeGzWriter
parentd8abf8f47046087317e785897d7b829a31fecac4 (diff)
Add some extra information when the Cura can't write the files.
Diffstat (limited to 'plugins/GCodeGzWriter')
-rw-r--r--plugins/GCodeGzWriter/GCodeGzWriter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/GCodeGzWriter/GCodeGzWriter.py b/plugins/GCodeGzWriter/GCodeGzWriter.py
index 6ddecdb0bd..e191a9c427 100644
--- a/plugins/GCodeGzWriter/GCodeGzWriter.py
+++ b/plugins/GCodeGzWriter/GCodeGzWriter.py
@@ -10,6 +10,9 @@ from UM.Mesh.MeshWriter import MeshWriter #The class we're extending/implementin
from UM.PluginRegistry import PluginRegistry
from UM.Scene.SceneNode import SceneNode #For typing.
+from UM.i18n import i18nCatalog
+catalog = i18nCatalog("cura")
+
## A file writer that writes gzipped g-code.
#
# If you're zipping g-code, you might as well use gzip!
@@ -28,12 +31,15 @@ class GCodeGzWriter(MeshWriter):
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode = MeshWriter.OutputMode.BinaryMode) -> bool:
if mode != MeshWriter.OutputMode.BinaryMode:
Logger.log("e", "GCodeGzWriter does not support text mode.")
+ self.setInformation(catalog.i18nc("@error:not supported", "GCodeGzWriter does not support text mode."))
return False
#Get the g-code from the g-code writer.
gcode_textio = StringIO() #We have to convert the g-code into bytes.
- success = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter")).write(gcode_textio, None)
+ gcode_writer = cast(MeshWriter, PluginRegistry.getInstance().getPluginObject("GCodeWriter"))
+ success = gcode_writer.write(gcode_textio, None)
if not success: #Writing the g-code failed. Then I can also not write the gzipped g-code.
+ self.setInformation(gcode_writer.getInformation())
return False
result = gzip.compress(gcode_textio.getvalue().encode("utf-8"))