mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Revert "Fix gcode.gz double extension problem on Mac"
This reverts commit fa90fcf18e
.
CURA-5228
This commit is contained in:
parent
340916179a
commit
2ba7a6e462
3 changed files with 8 additions and 14 deletions
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
import gzip
|
import gzip
|
||||||
|
|
||||||
from UM.Platform import Platform
|
from io import TextIOWrapper
|
||||||
|
|
||||||
from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementing.
|
from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementing.
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
|
|
||||||
|
|
||||||
## A file reader that reads gzipped g-code.
|
## A file reader that reads gzipped g-code.
|
||||||
#
|
#
|
||||||
# If you're zipping g-code, you might as well use gzip!
|
# If you're zipping g-code, you might as well use gzip!
|
||||||
|
@ -15,7 +15,7 @@ class GCodeGzReader(MeshReader):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._supported_extensions = [".gz"]
|
self._supported_extensions = [".gcode.gz"]
|
||||||
|
|
||||||
def read(self, file_name):
|
def read(self, file_name):
|
||||||
with open(file_name, "rb") as file:
|
with open(file_name, "rb") as file:
|
||||||
|
|
|
@ -1,24 +1,21 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# 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 . import GCodeGzReader
|
||||||
|
|
||||||
|
from UM.i18n import i18nCatalog
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
file_extension = "gz" if Platform.isOSX() else "gcode.gz"
|
|
||||||
return {
|
return {
|
||||||
"mesh_reader": [
|
"mesh_reader": [
|
||||||
{
|
{
|
||||||
"extension": file_extension,
|
"extension": "gcode.gz",
|
||||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Compressed G-code File")
|
"description": i18n_catalog.i18nc("@item:inlistbox", "Compressed G-code File")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
def register(app):
|
def register(app):
|
||||||
app.addNonSliceableExtension(".gz")
|
app.addNonSliceableExtension(".gcode.gz")
|
||||||
return { "mesh_reader": GCodeGzReader.GCodeGzReader() }
|
return { "mesh_reader": GCodeGzReader.GCodeGzReader() }
|
||||||
|
|
|
@ -1,19 +1,16 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# 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 . import GCodeGzWriter
|
||||||
|
|
||||||
|
from UM.i18n import i18nCatalog
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
file_extension = "gz" if Platform.isOSX() else "gcode.gz"
|
|
||||||
return {
|
return {
|
||||||
"mesh_writer": {
|
"mesh_writer": {
|
||||||
"output": [{
|
"output": [{
|
||||||
"extension": file_extension,
|
"extension": "gcode.gz",
|
||||||
"description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"),
|
"description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"),
|
||||||
"mime_type": "application/gzip",
|
"mime_type": "application/gzip",
|
||||||
"mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode
|
"mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue