CURA-5164 Make the mesh readers compliant with the new signature of the mesh reader. Also adapt the tests.

This commit is contained in:
Diego Prado Gesto 2018-05-23 17:17:41 +02:00
parent 39768e29cc
commit ddd7b056f3
10 changed files with 20 additions and 20 deletions

View file

@ -12,11 +12,11 @@ from UM.PluginRegistry import PluginRegistry
# If you're zipping g-code, you might as well use gzip!
class GCodeGzReader(MeshReader):
def __init__(self):
super().__init__()
def __init__(self, application):
super().__init__(application)
self._supported_extensions = [".gcode.gz"]
def read(self, file_name):
def _read(self, file_name):
with open(file_name, "rb") as file:
file_data = file.read()
uncompressed_gcode = gzip.decompress(file_data).decode("utf-8")

View file

@ -21,4 +21,4 @@ def getMetaData():
def register(app):
app.addNonSliceableExtension(".gz")
return { "mesh_reader": GCodeGzReader.GCodeGzReader() }
return { "mesh_reader": GCodeGzReader.GCodeGzReader(app) }