diff options
-rw-r--r-- | plugins/GCodeGzReader/GCodeGzReader.py | 6 | ||||
-rw-r--r-- | plugins/GCodeGzReader/__init__.py | 9 | ||||
-rw-r--r-- | plugins/GCodeGzWriter/__init__.py | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/plugins/GCodeGzReader/GCodeGzReader.py b/plugins/GCodeGzReader/GCodeGzReader.py index 0843f8f3c0..fd9bf0ed84 100644 --- a/plugins/GCodeGzReader/GCodeGzReader.py +++ b/plugins/GCodeGzReader/GCodeGzReader.py @@ -3,11 +3,11 @@ import gzip -from io import TextIOWrapper - +from UM.Platform import Platform from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementing. from UM.PluginRegistry import PluginRegistry + ## A file reader that reads gzipped g-code. # # If you're zipping g-code, you might as well use gzip! @@ -15,7 +15,7 @@ class GCodeGzReader(MeshReader): def __init__(self): super().__init__() - self._supported_extensions = [".gcode.gz"] + self._supported_extensions = [".gz"] def read(self, file_name): with open(file_name, "rb") as file: diff --git a/plugins/GCodeGzReader/__init__.py b/plugins/GCodeGzReader/__init__.py index 98965c00aa..6e720b1ed1 100644 --- a/plugins/GCodeGzReader/__init__.py +++ b/plugins/GCodeGzReader/__init__.py @@ -1,21 +1,24 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from UM.i18n import i18nCatalog +from UM.Platform import Platform + from . import GCodeGzReader -from UM.i18n import i18nCatalog i18n_catalog = i18nCatalog("cura") def getMetaData(): + file_extension = "gz" if Platform.isOSX() else "gcode.gz" return { "mesh_reader": [ { - "extension": "gcode.gz", + "extension": file_extension, "description": i18n_catalog.i18nc("@item:inlistbox", "Compressed G-code File") } ] } def register(app): - app.addNonSliceableExtension(".gcode.gz") + app.addNonSliceableExtension(".gz") return { "mesh_reader": GCodeGzReader.GCodeGzReader() } diff --git a/plugins/GCodeGzWriter/__init__.py b/plugins/GCodeGzWriter/__init__.py index c001467b3d..a4d576aef6 100644 --- a/plugins/GCodeGzWriter/__init__.py +++ b/plugins/GCodeGzWriter/__init__.py @@ -1,16 +1,19 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from UM.i18n import i18nCatalog +from UM.Platform import Platform + from . import GCodeGzWriter -from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") def getMetaData(): + file_extension = "gz" if Platform.isOSX() else "gcode.gz" return { "mesh_writer": { "output": [{ - "extension": "gcode.gz", + "extension": file_extension, "description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"), "mime_type": "application/gzip", "mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode |