CURA-5128 cleanup .gz and only leave .gcode.gz as Cura and Uranium now accept extensions with multiple periods

This commit is contained in:
Jack Ha 2018-03-22 14:35:21 +01:00
parent a0badf121a
commit c2888529cb
3 changed files with 8 additions and 4 deletions

View File

@ -1625,8 +1625,13 @@ class CuraApplication(QtApplication):
node.setName(os.path.basename(filename))
self.getBuildVolume().checkBoundsAndUpdate(node)
extension = os.path.splitext(filename)[1]
if extension.lower() in self._non_sliceable_extensions:
is_non_sliceable = False
filename_lower = filename.lower()
for extension in self._non_sliceable_extensions:
if filename_lower.endswith(extension):
is_non_sliceable = True
break
if is_non_sliceable:
self.callLater(lambda: self.getController().setActiveView("SimulationView"))
block_slicing_decorator = BlockSlicingDecorator()

View File

@ -19,7 +19,7 @@ class GCodeGzReader(MeshReader):
def __init__(self):
super(GCodeGzReader, self).__init__()
self._supported_extensions = [".gcode.gz", ".gz"]
self._supported_extensions = [".gcode.gz"]
def read(self, file_name):
with open(file_name, "rb") as file:

View File

@ -18,5 +18,4 @@ def getMetaData():
def register(app):
app.addNonSliceableExtension(".gcode.gz")
app.addNonSliceableExtension(".gz") # in some parts only the last extension is taken. Let's make it a non sliceable extension for now
return { "mesh_reader": GCodeGzReader.GCodeGzReader() }