diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-09-27 14:58:06 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-09-27 14:58:06 +0300 |
commit | 0ce9bf61beb1ed6bf72319b42330cd69251b959e (patch) | |
tree | f79304a384e1adcbf9fd01ff15c83d59ab8b38ae /plugins/GCodeGzReader | |
parent | 88ba2ac3451834db5a11169214d410c8aa3f726d (diff) |
Move MIME type declarations into constructors of readers
So that if you disable the plug-in, the MIME type declaration is also not added.
Fixes #4151.
Diffstat (limited to 'plugins/GCodeGzReader')
-rw-r--r-- | plugins/GCodeGzReader/GCodeGzReader.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/GCodeGzReader/GCodeGzReader.py b/plugins/GCodeGzReader/GCodeGzReader.py index 4d33f00870..d075e4e3b0 100644 --- a/plugins/GCodeGzReader/GCodeGzReader.py +++ b/plugins/GCodeGzReader/GCodeGzReader.py @@ -7,20 +7,19 @@ from UM.Mesh.MeshReader import MeshReader #The class we're extending/implementin from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType #To add the .gcode.gz files to the MIME type database. from UM.PluginRegistry import PluginRegistry -MimeTypeDatabase.addMimeType( - MimeType( - name = "application/x-cura-compressed-gcode-file", - comment = "Cura Compressed GCode File", - suffixes = ["gcode.gz"] - ) -) - ## A file reader that reads gzipped g-code. # # If you're zipping g-code, you might as well use gzip! class GCodeGzReader(MeshReader): def __init__(self) -> None: super().__init__() + MimeTypeDatabase.addMimeType( + MimeType( + name = "application/x-cura-compressed-gcode-file", + comment = "Cura Compressed GCode File", + suffixes = ["gcode.gz"] + ) + ) self._supported_extensions = [".gcode.gz"] def _read(self, file_name): |