diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 450cafdeda..6bfe920863 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -38,8 +38,8 @@ except ImportError: ## Base implementation for reading 3MF files. Has no support for textures. Only loads meshes! class ThreeMFReader(MeshReader): - def __init__(self, application): - super().__init__(application) + def __init__(self) -> None: + super().__init__() MimeTypeDatabase.addMimeType( MimeType( diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py index feabf19818..3a4fde4ab8 100644 --- a/plugins/3MFReader/__init__.py +++ b/plugins/3MFReader/__init__.py @@ -18,7 +18,7 @@ catalog = i18nCatalog("cura") def getMetaData() -> Dict: - # Workarround for osx not supporting double file extensions correctly. + # Workaround for osx not supporting double file extensions correctly. if Platform.isOSX(): workspace_extension = "3mf" else: @@ -44,7 +44,7 @@ def getMetaData() -> Dict: def register(app): if "3MFReader.ThreeMFReader" in sys.modules: - return {"mesh_reader": ThreeMFReader.ThreeMFReader(app), + return {"mesh_reader": ThreeMFReader.ThreeMFReader(), "workspace_reader": ThreeMFWorkspaceReader.ThreeMFWorkspaceReader()} else: return {} diff --git a/plugins/GCodeGzReader/GCodeGzReader.py b/plugins/GCodeGzReader/GCodeGzReader.py index 7a6a76d4a5..73a08075d2 100644 --- a/plugins/GCodeGzReader/GCodeGzReader.py +++ b/plugins/GCodeGzReader/GCodeGzReader.py @@ -11,9 +11,8 @@ from UM.PluginRegistry import PluginRegistry # # If you're zipping g-code, you might as well use gzip! class GCodeGzReader(MeshReader): - - def __init__(self, application): - super().__init__(application) + def __init__(self) -> None: + super().__init__() self._supported_extensions = [".gcode.gz"] def _read(self, file_name): diff --git a/plugins/GCodeGzReader/__init__.py b/plugins/GCodeGzReader/__init__.py index e6bae6615e..3d7ae85d30 100644 --- a/plugins/GCodeGzReader/__init__.py +++ b/plugins/GCodeGzReader/__init__.py @@ -19,6 +19,7 @@ def getMetaData(): ] } + def register(app): app.addNonSliceableExtension(".gz") - return { "mesh_reader": GCodeGzReader.GCodeGzReader(app) } + return {"mesh_reader": GCodeGzReader.GCodeGzReader()} diff --git a/plugins/GCodeReader/GCodeReader.py b/plugins/GCodeReader/GCodeReader.py index c51fc9c8a7..45ef1e1058 100755 --- a/plugins/GCodeReader/GCodeReader.py +++ b/plugins/GCodeReader/GCodeReader.py @@ -19,16 +19,16 @@ MimeTypeDatabase.addMimeType( ) ) + # Class for loading and parsing G-code files class GCodeReader(MeshReader): - _flavor_default = "Marlin" _flavor_keyword = ";FLAVOR:" _flavor_readers_dict = {"RepRap" : RepRapFlavorParser.RepRapFlavorParser(), "Marlin" : MarlinFlavorParser.MarlinFlavorParser()} - def __init__(self, application): - super(GCodeReader, self).__init__(application) + def __init__(self) -> None: + super().__init__() self._supported_extensions = [".gcode", ".g"] self._flavor_reader = None diff --git a/plugins/GCodeReader/__init__.py b/plugins/GCodeReader/__init__.py index 399de8a90e..4158a038b0 100644 --- a/plugins/GCodeReader/__init__.py +++ b/plugins/GCodeReader/__init__.py @@ -20,7 +20,8 @@ def getMetaData(): ] } + def register(app): app.addNonSliceableExtension(".gcode") app.addNonSliceableExtension(".g") - return { "mesh_reader": GCodeReader.GCodeReader(app) } + return {"mesh_reader": GCodeReader.GCodeReader()} diff --git a/plugins/ImageReader/ImageReader.py b/plugins/ImageReader/ImageReader.py index 89f163cfca..5195b61595 100644 --- a/plugins/ImageReader/ImageReader.py +++ b/plugins/ImageReader/ImageReader.py @@ -17,8 +17,8 @@ from cura.Scene.CuraSceneNode import CuraSceneNode as SceneNode class ImageReader(MeshReader): - def __init__(self, application): - super(ImageReader, self).__init__(application) + def __init__(self) -> None: + super().__init__() self._supported_extensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"] self._ui = ImageReaderUI(self) diff --git a/plugins/ImageReader/__init__.py b/plugins/ImageReader/__init__.py index f30fdb83b0..67ad106646 100644 --- a/plugins/ImageReader/__init__.py +++ b/plugins/ImageReader/__init__.py @@ -32,5 +32,6 @@ def getMetaData(): ] } + def register(app): - return { "mesh_reader": ImageReader.ImageReader(app) } + return {"mesh_reader": ImageReader.ImageReader()} diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index e57ec524db..44a2f1443a 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -26,8 +26,8 @@ except ImportError: DEFAULT_SUBDIV = 16 # Default subdivision factor for spheres, cones, and cylinders EPSILON = 0.000001 -class Shape: +class Shape: # Expects verts in MeshBuilder-ready format, as a n by 3 mdarray # with vertices stored in rows def __init__(self, verts, faces, index_base, name): @@ -37,9 +37,10 @@ class Shape: self.index_base = index_base self.name = name + class X3DReader(MeshReader): - def __init__(self, application): - super().__init__(application) + def __init__(self) -> None: + super().__init__() self._supported_extensions = [".x3d"] self._namespaces = {} diff --git a/plugins/X3DReader/__init__.py b/plugins/X3DReader/__init__.py index 03ed4ae301..624611ff02 100644 --- a/plugins/X3DReader/__init__.py +++ b/plugins/X3DReader/__init__.py @@ -15,5 +15,6 @@ def getMetaData(): ] } + def register(app): - return { "mesh_reader": X3DReader.X3DReader(app) } + return {"mesh_reader": X3DReader.X3DReader()}