Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNino van Hooff <ninovanhooff@gmail.com>2020-05-29 15:30:33 +0300
committerNino van Hooff <ninovanhooff@gmail.com>2020-05-29 15:30:33 +0300
commit89f0970a887612a6819263633180d027d06224af (patch)
tree0b900495a95a234c15f893563975eb346aee6e20
parent1e33360c359373f7acbf95ca9706514d12c0dd7f (diff)
Remove trailing whitespace from Python files
-rwxr-xr-xcmake/mod_bundled_packages_json.py4
-rw-r--r--cura/API/Backups.py8
-rw-r--r--cura/API/Interface/Settings.py8
-rw-r--r--cura/API/Interface/__init__.py4
-rw-r--r--cura/Arranging/ShapeArray.py8
-rw-r--r--cura/Backups/Backup.py10
-rwxr-xr-xcura/BuildVolume.py22
-rw-r--r--cura/CrashHandler.py2
-rw-r--r--cura/CuraActions.py4
-rwxr-xr-xcura/CuraApplication.py14
-rw-r--r--cura/Layer.py8
-rw-r--r--cura/LayerData.py2
-rwxr-xr-xcura/LayerDataBuilder.py2
-rw-r--r--cura/LayerPolygon.py24
-rw-r--r--cura/MachineAction.py4
-rw-r--r--cura/Machines/ContainerNode.py10
-rw-r--r--cura/Machines/ContainerTree.py20
-rw-r--r--cura/Machines/IntentNode.py2
-rw-r--r--cura/Machines/MachineNode.py12
-rw-r--r--cura/Machines/MaterialGroup.py6
-rw-r--r--cura/Machines/MaterialNode.py4
-rw-r--r--cura/Machines/Models/BaseMaterialsModel.py4
-rw-r--r--cura/Machines/Models/DiscoveredPrintersModel.py2
-rw-r--r--cura/Machines/Models/ExtrudersModel.py10
-rw-r--r--cura/Machines/Models/IntentCategoryModel.py2
-rw-r--r--cura/Machines/Models/MaterialManagementModel.py16
-rw-r--r--cura/Machines/Models/QualityManagementModel.py16
-rw-r--r--cura/Machines/QualityChangesGroup.py2
-rw-r--r--cura/Machines/QualityGroup.py6
-rw-r--r--cura/Machines/QualityNode.py4
-rw-r--r--cura/Machines/VariantNode.py10
-rw-r--r--cura/OAuth2/AuthorizationHelpers.py24
-rw-r--r--cura/OAuth2/AuthorizationRequestHandler.py8
-rw-r--r--cura/OAuth2/AuthorizationRequestServer.py4
-rw-r--r--cura/OAuth2/AuthorizationService.py2
-rw-r--r--cura/OAuth2/LocalAuthorizationServer.py14
-rw-r--r--cura/OneAtATimeIterator.py6
-rw-r--r--cura/Operations/SetParentOperation.py6
-rw-r--r--cura/PickingPass.py4
-rwxr-xr-xcura/PlatformPhysics.py6
-rw-r--r--cura/PreviewPass.py4
-rw-r--r--cura/PrinterOutput/FirmwareUpdater.py2
-rw-r--r--cura/PrinterOutput/Models/ExtruderConfigurationModel.py2
-rw-r--r--cura/PrinterOutput/Models/ExtruderOutputModel.py2
-rw-r--r--cura/PrinterOutput/Models/PrinterConfigurationModel.py4
-rw-r--r--cura/PrinterOutput/Models/PrinterOutputModel.py2
-rw-r--r--cura/PrinterOutput/NetworkedPrinterOutputDevice.py14
-rw-r--r--cura/PrinterOutput/Peripheral.py4
-rw-r--r--cura/PrinterOutput/PrinterOutputDevice.py10
-rw-r--r--cura/ReaderWriters/ProfileReader.py4
-rw-r--r--cura/ReaderWriters/ProfileWriter.py8
-rw-r--r--cura/Scene/ConvexHullDecorator.py20
-rw-r--r--cura/Scene/ConvexHullNode.py2
-rw-r--r--cura/Scene/CuraSceneNode.py4
-rw-r--r--cura/Scene/SliceableObjectDecorator.py2
-rw-r--r--cura/Settings/ContainerManager.py30
-rwxr-xr-xcura/Settings/CuraContainerStack.py64
-rw-r--r--cura/Settings/CuraStackBuilder.py14
-rw-r--r--cura/Settings/ExtruderStack.py16
-rwxr-xr-xcura/Settings/GlobalStack.py20
-rw-r--r--cura/Settings/IntentManager.py16
-rwxr-xr-xcura/Settings/MachineManager.py44
-rw-r--r--cura/Settings/MachineNameValidator.py4
-rw-r--r--cura/Settings/SettingOverrideDecorator.py14
-rw-r--r--cura/UI/MachineActionManager.py14
-rw-r--r--cura/UI/PrintInformation.py2
-rw-r--r--cura/Utils/Decorators.py4
-rwxr-xr-xplugins/3MFReader/ThreeMFReader.py10
-rwxr-xr-xplugins/3MFReader/ThreeMFWorkspaceReader.py12
-rw-r--r--plugins/3MFReader/__init__.py2
-rw-r--r--plugins/3MFWriter/ThreeMFWorkspaceWriter.py2
-rw-r--r--plugins/3MFWriter/ThreeMFWriter.py4
-rw-r--r--plugins/AMFReader/AMFReader.py2
-rwxr-xr-xplugins/CuraEngineBackend/CuraEngineBackend.py2
-rw-r--r--plugins/CuraEngineBackend/ProcessSlicedLayersJob.py4
-rw-r--r--plugins/CuraProfileReader/CuraProfileReader.py12
-rw-r--r--plugins/CuraProfileWriter/CuraProfileWriter.py2
-rw-r--r--plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py6
-rw-r--r--plugins/GCodeGzReader/GCodeGzReader.py2
-rw-r--r--plugins/GCodeGzWriter/GCodeGzWriter.py6
-rw-r--r--plugins/GCodeProfileReader/GCodeProfileReader.py10
-rw-r--r--plugins/GCodeReader/FlavorParser.py2
-rw-r--r--plugins/GCodeReader/RepRapFlavorParser.py4
-rw-r--r--plugins/GCodeWriter/GCodeWriter.py18
-rw-r--r--plugins/LegacyProfileReader/LegacyProfileReader.py16
-rwxr-xr-xplugins/MachineSettingsAction/MachineSettingsAction.py4
-rw-r--r--plugins/ModelChecker/ModelChecker.py2
-rw-r--r--plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py2
-rw-r--r--plugins/PerObjectSettingsTool/PerObjectSettingsTool.py6
-rw-r--r--plugins/PostProcessingPlugin/PostProcessingPlugin.py6
-rw-r--r--plugins/PostProcessingPlugin/Script.py8
-rw-r--r--plugins/PostProcessingPlugin/scripts/ColorMix.py8
-rw-r--r--plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py4
-rw-r--r--plugins/PostProcessingPlugin/scripts/FilamentChange.py2
-rw-r--r--plugins/PostProcessingPlugin/scripts/SearchAndReplace.py2
-rw-r--r--plugins/PostProcessingPlugin/scripts/UsePreviousProbeMeasurements.py2
-rw-r--r--plugins/PreviewStage/PreviewStage.py8
-rw-r--r--plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py2
-rw-r--r--plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py8
-rw-r--r--plugins/SentryLogger/SentryLogger.py6
-rwxr-xr-xplugins/SliceInfoPlugin/SliceInfo.py4
-rw-r--r--plugins/Toolbox/src/AuthorsModel.py2
-rw-r--r--plugins/Toolbox/src/CloudSync/DiscrepanciesPresenter.py2
-rw-r--r--plugins/Toolbox/src/CloudSync/DownloadPresenter.py2
-rw-r--r--plugins/Toolbox/src/CloudSync/LicensePresenter.py2
-rw-r--r--plugins/Toolbox/src/CloudSync/RestartApplicationPresenter.py2
-rw-r--r--plugins/Toolbox/src/CloudSync/SyncOrchestrator.py4
-rw-r--r--plugins/Toolbox/src/PackagesModel.py2
-rw-r--r--plugins/Toolbox/src/Toolbox.py4
-rw-r--r--plugins/TrimeshReader/TrimeshReader.py4
-rw-r--r--plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py14
-rw-r--r--plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/MeshFormatHandler.py8
-rw-r--r--plugins/UM3NetworkPrinting/src/Messages/PrintJobUploadProgressMessage.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/BaseModel.py10
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterStatus.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudError.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobResponse.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobUploadRequest.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintResponse.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterBuildPlate.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py6
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConstraint.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobImpediment.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobStatus.py6
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py4
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStation.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStationSlot.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py10
-rw-r--r--plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py18
-rw-r--r--plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py10
-rw-r--r--plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py12
-rw-r--r--plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py6
-rw-r--r--plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterAction.py2
-rw-r--r--plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py10
-rw-r--r--plugins/USBPrinting/USBPrinterOutputDevice.py4
-rw-r--r--plugins/USBPrinting/USBPrinterOutputDeviceManager.py2
-rw-r--r--plugins/USBPrinting/avr_isp/intelHex.py2
-rw-r--r--plugins/USBPrinting/avr_isp/ispBase.py2
-rw-r--r--plugins/USBPrinting/avr_isp/stk500v2.py2
-rw-r--r--plugins/UltimakerMachineActions/BedLevelMachineAction.py2
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py6
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py6
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py4
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py4
-rw-r--r--plugins/XmlMaterialProfile/XmlMaterialProfile.py12
-rwxr-xr-xscripts/check_gcode_buffer.py4
-rw-r--r--scripts/lionbridge_import.py10
-rw-r--r--tests/Machines/TestMachineNode.py6
-rw-r--r--tests/Machines/TestVariantNode.py6
-rw-r--r--tests/Settings/MockContainer.py28
-rw-r--r--tests/Settings/TestDefinitionContainer.py8
-rw-r--r--tests/Settings/TestExtruderStack.py2
-rwxr-xr-xtests/Settings/TestGlobalStack.py4
157 files changed, 562 insertions, 562 deletions
diff --git a/cmake/mod_bundled_packages_json.py b/cmake/mod_bundled_packages_json.py
index 66038b30e2..e03261b479 100755
--- a/cmake/mod_bundled_packages_json.py
+++ b/cmake/mod_bundled_packages_json.py
@@ -13,7 +13,7 @@ import sys
def find_json_files(work_dir: str) -> list:
"""Finds all JSON files in the given directory recursively and returns a list of those files in absolute paths.
-
+
:param work_dir: The directory to look for JSON files recursively.
:return: A list of JSON files in absolute paths that are found in the given directory.
"""
@@ -28,7 +28,7 @@ def find_json_files(work_dir: str) -> list:
def remove_entries_from_json_file(file_path: str, entries: list) -> None:
"""Removes the given entries from the given JSON file. The file will modified in-place.
-
+
:param file_path: The JSON file to modify.
:param entries: A list of strings as entries to remove.
:return: None
diff --git a/cura/API/Backups.py b/cura/API/Backups.py
index cb5f2aa487..1940d38a36 100644
--- a/cura/API/Backups.py
+++ b/cura/API/Backups.py
@@ -10,9 +10,9 @@ if TYPE_CHECKING:
class Backups:
"""The back-ups API provides a version-proof bridge between Cura's
-
+
BackupManager and plug-ins that hook into it.
-
+
Usage:
.. code-block:: python
@@ -28,7 +28,7 @@ class Backups:
def createBackup(self) -> Tuple[Optional[bytes], Optional[Dict[str, Any]]]:
"""Create a new back-up using the BackupsManager.
-
+
:return: Tuple containing a ZIP file with the back-up data and a dict with metadata about the back-up.
"""
@@ -36,7 +36,7 @@ class Backups:
def restoreBackup(self, zip_file: bytes, meta_data: Dict[str, Any]) -> None:
"""Restore a back-up using the BackupsManager.
-
+
:param zip_file: A ZIP file containing the actual back-up data.
:param meta_data: Some metadata needed for restoring a back-up, like the Cura version number.
"""
diff --git a/cura/API/Interface/Settings.py b/cura/API/Interface/Settings.py
index 18653bc88e..706a6d8c74 100644
--- a/cura/API/Interface/Settings.py
+++ b/cura/API/Interface/Settings.py
@@ -10,9 +10,9 @@ if TYPE_CHECKING:
class Settings:
"""The Interface.Settings API provides a version-proof bridge
between Cura's
-
+
(currently) sidebar UI and plug-ins that hook into it.
-
+
Usage:
.. code-block:: python
@@ -34,7 +34,7 @@ class Settings:
def addContextMenuItem(self, menu_item: dict) -> None:
"""Add items to the sidebar context menu.
-
+
:param menu_item: dict containing the menu item to add.
"""
@@ -42,7 +42,7 @@ class Settings:
def getContextMenuItems(self) -> list:
"""Get all custom items currently added to the sidebar context menu.
-
+
:return: List containing all custom context menu items.
"""
diff --git a/cura/API/Interface/__init__.py b/cura/API/Interface/__init__.py
index 13174070d1..61510d6262 100644
--- a/cura/API/Interface/__init__.py
+++ b/cura/API/Interface/__init__.py
@@ -11,9 +11,9 @@ if TYPE_CHECKING:
class Interface:
"""The Interface class serves as a common root for the specific API
-
+
methods for each interface element.
-
+
Usage:
.. code-block:: python
diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py
index c704ae7ca2..840f9731c2 100644
--- a/cura/Arranging/ShapeArray.py
+++ b/cura/Arranging/ShapeArray.py
@@ -23,7 +23,7 @@ class ShapeArray:
@classmethod
def fromPolygon(cls, vertices: numpy.array, scale: float = 1) -> "ShapeArray":
"""Instantiate from a bunch of vertices
-
+
:param vertices:
:param scale: scale the coordinates
:return: a shape array instantiated from a bunch of vertices
@@ -52,7 +52,7 @@ class ShapeArray:
@classmethod
def fromNode(cls, node: "SceneNode", min_offset: float, scale: float = 0.5, include_children: bool = False) -> Tuple[Optional["ShapeArray"], Optional["ShapeArray"]]:
"""Instantiate an offset and hull ShapeArray from a scene node.
-
+
:param node: source node where the convex hull must be present
:param min_offset: offset for the offset ShapeArray
:param scale: scale the coordinates
@@ -100,7 +100,7 @@ class ShapeArray:
@classmethod
def arrayFromPolygon(cls, shape: Tuple[int, int], vertices: numpy.array) -> numpy.array:
"""Create :py:class:`numpy.ndarray` with dimensions defined by shape
-
+
Fills polygon defined by vertices with ones, all other values zero
Only works correctly for convex hull vertices
Originally from: `Stackoverflow - generating a filled polygon inside a numpy array <https://stackoverflow.com/questions/37117878/generating-a-filled-polygon-inside-a-numpy-array>`_
@@ -128,7 +128,7 @@ class ShapeArray:
@classmethod
def _check(cls, p1: numpy.array, p2: numpy.array, base_array: numpy.array) -> Optional[numpy.array]:
"""Return indices that mark one side of the line, used by arrayFromPolygon
-
+
Uses the line defined by p1 and p2 to check array of
input indices against interpolated value
Returns boolean array, with True inside and False outside of shape
diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py
index 6d1906e1dc..44e1feef30 100644
--- a/cura/Backups/Backup.py
+++ b/cura/Backups/Backup.py
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
class Backup:
"""The back-up class holds all data about a back-up.
-
+
It is also responsible for reading and writing the zip file to the user data folder.
"""
@@ -68,7 +68,7 @@ class Backup:
material_count = len([s for s in files if "materials/" in s]) - 1
profile_count = len([s for s in files if "quality_changes/" in s]) - 1
plugin_count = len([s for s in files if "plugin.json" in s])
-
+
# Store the archive and metadata so the BackupManager can fetch them when needed.
self.zip_file = buffer.getvalue()
self.meta_data = {
@@ -81,7 +81,7 @@ class Backup:
def _makeArchive(self, buffer: "io.BytesIO", root_path: str) -> Optional[ZipFile]:
"""Make a full archive from the given root path with the given name.
-
+
:param root_path: The root directory to archive recursively.
:return: The archive as bytes.
"""
@@ -111,7 +111,7 @@ class Backup:
def restore(self) -> bool:
"""Restore this back-up.
-
+
:return: Whether we had success or not.
"""
@@ -151,7 +151,7 @@ class Backup:
@staticmethod
def _extractArchive(archive: "ZipFile", target_path: str) -> bool:
"""Extract the whole archive to the given target path.
-
+
:param archive: The archive as ZipFile.
:param target_path: The target path.
:return: Whether we had success or not.
diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py
index cf0e18ad6a..315eca9fe5 100755
--- a/cura/BuildVolume.py
+++ b/cura/BuildVolume.py
@@ -166,7 +166,7 @@ class BuildVolume(SceneNode):
def _updateNodeListeners(self, node: SceneNode):
"""Updates the listeners that listen for changes in per-mesh stacks.
-
+
:param node: The node for which the decorators changed.
"""
@@ -587,7 +587,7 @@ class BuildVolume(SceneNode):
def _calculateExtraZClearance(self, extruders: List["ContainerStack"]) -> float:
if not self._global_container_stack:
return 0
-
+
extra_z = 0.0
for extruder in extruders:
if extruder.getProperty("retraction_hop_enabled", "value"):
@@ -728,7 +728,7 @@ class BuildVolume(SceneNode):
def _updateDisallowedAreasAndRebuild(self):
"""Calls :py:meth:`cura.BuildVolume._updateDisallowedAreas` and makes sure the changes appear in the scene.
-
+
This is required for a signal to trigger the update in one go. The
:py:meth:`cura.BuildVolume._updateDisallowedAreas` method itself shouldn't call
:py:meth:`cura.BuildVolume.rebuild`, since there may be other changes before it needs to be rebuilt,
@@ -798,9 +798,9 @@ class BuildVolume(SceneNode):
def _computeDisallowedAreasPrinted(self, used_extruders):
"""Computes the disallowed areas for objects that are printed with print features.
-
+
This means that the brim, travel avoidance and such will be applied to these features.
-
+
:return: A dictionary with for each used extruder ID the disallowed areas where that extruder may not print.
"""
@@ -843,10 +843,10 @@ class BuildVolume(SceneNode):
def _computeDisallowedAreasPrimeBlob(self, border_size: float, used_extruders: List["ExtruderStack"]) -> Dict[str, List[Polygon]]:
"""Computes the disallowed areas for the prime blobs.
-
+
These are special because they are not subject to things like brim or travel avoidance. They do get a dilute
with the border size though because they may not intersect with brims and such of other objects.
-
+
:param border_size: The size with which to offset the disallowed areas due to skirt, brim, travel avoid distance
, etc.
:param used_extruders: The extruder stacks to generate disallowed areas for.
@@ -882,7 +882,7 @@ class BuildVolume(SceneNode):
def _computeDisallowedAreasStatic(self, border_size:float, used_extruders: List["ExtruderStack"]) -> Dict[str, List[Polygon]]:
"""Computes the disallowed areas that are statically placed in the machine.
-
+
It computes different disallowed areas depending on the offset of the extruder. The resulting dictionary will
therefore have an entry for each extruder that is used.
@@ -1024,9 +1024,9 @@ class BuildVolume(SceneNode):
def _getSettingFromAllExtruders(self, setting_key: str) -> List[Any]:
"""Private convenience function to get a setting from every extruder.
-
+
For single extrusion machines, this gets the setting from the global stack.
-
+
:return: A sequence of setting values, one for each extruder.
"""
@@ -1116,7 +1116,7 @@ class BuildVolume(SceneNode):
def getEdgeDisallowedSize(self):
"""Calculate the disallowed radius around the edge.
-
+
This disallowed radius is to allow for space around the models that is not part of the collision radius,
such as bed adhesion (skirt/brim/raft) and travel avoid distance.
"""
diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py
index 75fdd99798..052f963fd4 100644
--- a/cura/CrashHandler.py
+++ b/cura/CrashHandler.py
@@ -237,7 +237,7 @@ class CrashHandler:
scope.set_tag("locale_os", self.data["locale_os"])
scope.set_tag("locale_cura", self.cura_locale)
scope.set_tag("is_enterprise", ApplicationMetadata.IsEnterpriseVersion)
-
+
scope.set_user({"id": str(uuid.getnode())})
return group
diff --git a/cura/CuraActions.py b/cura/CuraActions.py
index 3b37c69adc..4f3e842379 100644
--- a/cura/CuraActions.py
+++ b/cura/CuraActions.py
@@ -78,7 +78,7 @@ class CuraActions(QObject):
@pyqtSlot(int)
def multiplySelection(self, count: int) -> None:
"""Multiply all objects in the selection
-
+
:param count: The number of times to multiply the selection.
"""
@@ -114,7 +114,7 @@ class CuraActions(QObject):
@pyqtSlot(str)
def setExtruderForSelection(self, extruder_id: str) -> None:
"""Set the extruder that should be used to print the selection.
-
+
:param extruder_id: The ID of the extruder stack to use for the selected objects.
"""
diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py
index 4cd48e6bb3..9d53fa2c1f 100755
--- a/cura/CuraApplication.py
+++ b/cura/CuraApplication.py
@@ -730,7 +730,7 @@ class CuraApplication(QtApplication):
def _loadPlugins(self) -> None:
"""Handle loading of all plugin types (and the backend explicitly)
-
+
:py:class:`Uranium.UM.PluginRegistry`
"""
@@ -759,7 +759,7 @@ class CuraApplication(QtApplication):
def _setLoadingHint(self, hint: str):
"""Set a short, user-friendly hint about current loading status.
-
+
The way this message is displayed depends on application state
"""
@@ -1010,7 +1010,7 @@ class CuraApplication(QtApplication):
def getMachineActionManager(self, *args: Any) -> MachineActionManager.MachineActionManager:
"""Get the machine action manager
-
+
We ignore any *args given to this, as we also register the machine manager as qml singleton.
It wants to give this function an engine and script engine, but we don't care about that.
"""
@@ -1068,7 +1068,7 @@ class CuraApplication(QtApplication):
def registerObjects(self, engine):
"""Registers objects for the QML engine to use.
-
+
:param engine: The QML engine.
"""
@@ -1391,7 +1391,7 @@ class CuraApplication(QtApplication):
def arrange(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode]) -> None:
"""Arrange a set of nodes given a set of fixed nodes
-
+
:param nodes: nodes that we have to place
:param fixed_nodes: nodes that are placed in the arranger before finding spots for nodes
"""
@@ -1685,7 +1685,7 @@ class CuraApplication(QtApplication):
@pyqtSlot(str, "QVariant")
def addAdditionalComponent(self, area_id: str, component):
"""Add a component to a list of components to be reparented to another area in the GUI.
-
+
The actual reparenting is done by the area itself.
:param area_id: dentifying name of the area to which the component should be reparented
:param (QQuickComponent) component: The component that should be reparented
@@ -1707,7 +1707,7 @@ class CuraApplication(QtApplication):
@pyqtSlot(QUrl)
def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None):
"""Open a local file
-
+
:param project_mode: How to handle project files. Either None(default): Follow user preference, "open_as_model"
or "open_as_project". This parameter is only considered if the file is a project file.
"""
diff --git a/cura/Layer.py b/cura/Layer.py
index 933d4436c9..af42488e2a 100644
--- a/cura/Layer.py
+++ b/cura/Layer.py
@@ -76,7 +76,7 @@ class Layer:
def createMeshOrJumps(self, make_mesh: bool) -> MeshData:
builder = MeshBuilder()
-
+
line_count = 0
if make_mesh:
for polygon in self._polygons:
@@ -87,7 +87,7 @@ class Layer:
# Reserve the necessary space for the data upfront
builder.reserveFaceAndVertexCount(2 * line_count, 4 * line_count)
-
+
for polygon in self._polygons:
# Filter out the types of lines we are not interested in depending on whether we are drawing the mesh or the jumps.
index_mask = numpy.logical_not(polygon.jumpMask) if make_mesh else polygon.jumpMask
@@ -96,7 +96,7 @@ class Layer:
points = numpy.concatenate((polygon.data[:-1], polygon.data[1:]), 1)[index_mask.ravel()]
# Line types of the points we want to draw
line_types = polygon.types[index_mask]
-
+
# Shift the z-axis according to previous implementation.
if make_mesh:
points[polygon.isInfillOrSkinType(line_types), 1::3] -= 0.01
@@ -118,5 +118,5 @@ class Layer:
f_colors = numpy.repeat(polygon.mapLineTypeToColor(line_types), 4, 0)
builder.addFacesWithColor(f_points, f_indices, f_colors)
-
+
return builder.build() \ No newline at end of file
diff --git a/cura/LayerData.py b/cura/LayerData.py
index 1b3f2a978e..e58fda597a 100644
--- a/cura/LayerData.py
+++ b/cura/LayerData.py
@@ -5,7 +5,7 @@ from UM.Mesh.MeshData import MeshData
class LayerData(MeshData):
"""Class to holds the layer mesh and information about the layers.
-
+
Immutable, use :py:class:`cura.LayerDataBuilder.LayerDataBuilder` to create one of these.
"""
diff --git a/cura/LayerDataBuilder.py b/cura/LayerDataBuilder.py
index e104273e37..d8801c9e7b 100755
--- a/cura/LayerDataBuilder.py
+++ b/cura/LayerDataBuilder.py
@@ -45,7 +45,7 @@ class LayerDataBuilder(MeshBuilder):
def build(self, material_color_map, line_type_brightness = 1.0):
"""Return the layer data as :py:class:`cura.LayerData.LayerData`.
-
+
:param material_color_map: [r, g, b, a] for each extruder row.
:param line_type_brightness: compatibility layer view uses line type brightness of 0.5
"""
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py
index 2cfff612b9..6e518e984a 100644
--- a/cura/LayerPolygon.py
+++ b/cura/LayerPolygon.py
@@ -62,21 +62,21 @@ class LayerPolygon:
# re-used and can save alot of memory usage.
self._color_map = LayerPolygon.getColorMap()
self._colors = self._color_map[self._types] # type: numpy.ndarray
-
+
# When type is used as index returns true if type == LayerPolygon.InfillType or type == LayerPolygon.SkinType or type == LayerPolygon.SupportInfillType
# Should be generated in better way, not hardcoded.
self._is_infill_or_skin_type_map = numpy.array([0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0], dtype = numpy.bool)
-
+
self._build_cache_line_mesh_mask = None # type: Optional[numpy.ndarray]
self._build_cache_needed_points = None # type: Optional[numpy.ndarray]
-
+
def buildCache(self) -> None:
# For the line mesh we do not draw Infill or Jumps. Therefore those lines are filtered out.
self._build_cache_line_mesh_mask = numpy.ones(self._jump_mask.shape, dtype = bool)
mesh_line_count = numpy.sum(self._build_cache_line_mesh_mask)
self._index_begin = 0
self._index_end = mesh_line_count
-
+
self._build_cache_needed_points = numpy.ones((len(self._types), 2), dtype = numpy.bool)
# Only if the type of line segment changes do we need to add an extra vertex to change colors
self._build_cache_needed_points[1:, 0][:, numpy.newaxis] = self._types[1:] != self._types[:-1]
@@ -88,9 +88,9 @@ class LayerPolygon:
def build(self, vertex_offset: int, index_offset: int, vertices: numpy.ndarray, colors: numpy.ndarray, line_dimensions: numpy.ndarray, feedrates: numpy.ndarray, extruders: numpy.ndarray, line_types: numpy.ndarray, indices: numpy.ndarray) -> None:
"""Set all the arrays provided by the function caller, representing the LayerPolygon
-
+
The arrays are either by vertex or by indices.
-
+
:param vertex_offset: determines where to start and end filling the arrays
:param index_offset: determines where to start and end filling the arrays
:param vertices: vertex numpy array to be filled
@@ -111,16 +111,16 @@ class LayerPolygon:
line_mesh_mask = self._build_cache_line_mesh_mask
needed_points_list = self._build_cache_needed_points
-
+
# Index to the points we need to represent the line mesh. This is constructed by generating simple
# start and end points for each line. For line segment n these are points n and n+1. Row n reads [n n+1]
# Then then the indices for the points we don't need are thrown away based on the pre-calculated list.
index_list = ( numpy.arange(len(self._types)).reshape((-1, 1)) + numpy.array([[0, 1]]) ).reshape((-1, 1))[needed_points_list.reshape((-1, 1))]
-
+
# The relative values of begin and end indices have already been set in buildCache, so we only need to offset them to the parents offset.
self._vertex_begin += vertex_offset
self._vertex_end += vertex_offset
-
+
# Points are picked based on the index list to get the vertices needed.
vertices[self._vertex_begin:self._vertex_end, :] = self._data[index_list, :]
@@ -142,14 +142,14 @@ class LayerPolygon:
# The relative values of begin and end indices have already been set in buildCache, so we only need to offset them to the parents offset.
self._index_begin += index_offset
self._index_end += index_offset
-
+
indices[self._index_begin:self._index_end, :] = numpy.arange(self._index_end-self._index_begin, dtype = numpy.int32).reshape((-1, 1))
# When the line type changes the index needs to be increased by 2.
indices[self._index_begin:self._index_end, :] += numpy.cumsum(needed_points_list[line_mesh_mask.ravel(), 0], dtype = numpy.int32).reshape((-1, 1))
# Each line segment goes from it's starting point p to p+1, offset by the vertex index.
# The -1 is to compensate for the neccecarily True value of needed_points_list[0,0] which causes an unwanted +1 in cumsum above.
indices[self._index_begin:self._index_end, :] += numpy.array([self._vertex_begin - 1, self._vertex_begin])
-
+
self._build_cache_line_mesh_mask = None
self._build_cache_needed_points = None
@@ -195,7 +195,7 @@ class LayerPolygon:
@property
def lineFeedrates(self):
return self._line_feedrates
-
+
@property
def jumpMask(self):
return self._jump_mask
diff --git a/cura/MachineAction.py b/cura/MachineAction.py
index e18c37ccb4..74b742ef4d 100644
--- a/cura/MachineAction.py
+++ b/cura/MachineAction.py
@@ -62,7 +62,7 @@ class MachineAction(QObject, PluginObject):
@pyqtSlot()
def reset(self) -> None:
"""Reset the action to it's default state.
-
+
This should not be re-implemented by child classes, instead re-implement _reset.
:py:meth:`cura.MachineAction.MachineAction._reset`
@@ -73,7 +73,7 @@ class MachineAction(QObject, PluginObject):
def _reset(self) -> None:
"""Protected implementation of reset.
-
+
See also :py:meth:`cura.MachineAction.MachineAction.reset`
"""
diff --git a/cura/Machines/ContainerNode.py b/cura/Machines/ContainerNode.py
index 1fb02b099f..5341edd0c6 100644
--- a/cura/Machines/ContainerNode.py
+++ b/cura/Machines/ContainerNode.py
@@ -11,14 +11,14 @@ from UM.Settings.InstanceContainer import InstanceContainer
class ContainerNode:
"""A node in the container tree. It represents one container.
-
+
The container it represents is referenced by its container_id. During normal use of the tree, this container is
not constructed. Only when parts of the tree need to get loaded in the container stack should it get constructed.
"""
def __init__(self, container_id: str) -> None:
"""Creates a new node for the container tree.
-
+
:param container_id: The ID of the container that this node should represent.
"""
@@ -28,7 +28,7 @@ class ContainerNode:
def getMetadata(self) -> Dict[str, Any]:
"""Gets the metadata of the container that this node represents.
-
+
Getting the metadata from the container directly is about 10x as fast.
:return: The metadata of the container in this node.
@@ -38,7 +38,7 @@ class ContainerNode:
def getMetaDataEntry(self, entry: str, default: Any = None) -> Any:
"""Get an entry from the metadata of the container that this node contains.
-
+
This is just a convenience function.
:param entry: The metadata entry key to return.
@@ -56,7 +56,7 @@ class ContainerNode:
@property
def container(self) -> Optional[InstanceContainer]:
"""The container that this node's container ID refers to.
-
+
This can be used to finally instantiate the container in order to put it in the container stack.
:return: A container.
diff --git a/cura/Machines/ContainerTree.py b/cura/Machines/ContainerTree.py
index 7902f8163c..7f1e7900d0 100644
--- a/cura/Machines/ContainerTree.py
+++ b/cura/Machines/ContainerTree.py
@@ -21,9 +21,9 @@ if TYPE_CHECKING:
class ContainerTree:
"""This class contains a look-up tree for which containers are available at which stages of configuration.
-
+
The tree starts at the machine definitions. For every distinct definition there will be one machine node here.
-
+
All of the fallbacks for material choices, quality choices, etc. should be encoded in this tree. There must
always be at least one child node (for nodes that have children) but that child node may be a node representing
the empty instance container.
@@ -44,7 +44,7 @@ class ContainerTree:
def getCurrentQualityGroups(self) -> Dict[str, "QualityGroup"]:
"""Get the quality groups available for the currently activated printer.
-
+
This contains all quality groups, enabled or disabled. To check whether the quality group can be activated,
test for the ``QualityGroup.is_available`` property.
@@ -61,7 +61,7 @@ class ContainerTree:
def getCurrentQualityChangesGroups(self) -> List["QualityChangesGroup"]:
"""Get the quality changes groups available for the currently activated printer.
-
+
This contains all quality changes groups, enabled or disabled. To check whether the quality changes group can
be activated, test for the ``QualityChangesGroup.is_available`` property.
@@ -84,7 +84,7 @@ class ContainerTree:
class _MachineNodeMap:
"""Dictionary-like object that contains the machines.
-
+
This handles the lazy loading of MachineNodes.
"""
@@ -105,7 +105,7 @@ class ContainerTree:
def __getitem__(self, definition_id: str) -> MachineNode:
"""Returns a machine node for the specified definition ID.
-
+
If the machine node wasn't loaded yet, this will load it lazily.
:param definition_id: The definition to look for.
@@ -122,7 +122,7 @@ class ContainerTree:
def get(self, definition_id: str, default: Optional[MachineNode] = None) -> Optional[MachineNode]:
"""Gets a machine node for the specified definition ID, with default.
-
+
The default is returned if there is no definition with the specified ID. If the machine node wasn't
loaded yet, this will load it lazily.
@@ -140,7 +140,7 @@ class ContainerTree:
def is_loaded(self, definition_id: str) -> bool:
"""Returns whether we've already cached this definition's node.
-
+
:param definition_id: The definition that we may have cached.
:return: ``True`` if it's cached.
@@ -155,7 +155,7 @@ class ContainerTree:
def __init__(self, tree_root: "ContainerTree", container_stacks: List["ContainerStack"]) -> None:
"""Creates a new background task.
-
+
:param tree_root: The container tree instance. This cannot be obtained through the singleton static
function since the instance may not yet be constructed completely.
:param container_stacks: All of the stacks to pre-load the container trees for. This needs to be provided
@@ -168,7 +168,7 @@ class ContainerTree:
def run(self) -> None:
"""Starts the background task.
-
+
The ``JobQueue`` will schedule this on a different thread.
"""
diff --git a/cura/Machines/IntentNode.py b/cura/Machines/IntentNode.py
index f25a171d55..949a5d3a2b 100644
--- a/cura/Machines/IntentNode.py
+++ b/cura/Machines/IntentNode.py
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
class IntentNode(ContainerNode):
"""This class represents an intent profile in the container tree.
-
+
This class has no more subnodes.
"""
diff --git a/cura/Machines/MachineNode.py b/cura/Machines/MachineNode.py
index c546f4d68d..d487ea57f2 100644
--- a/cura/Machines/MachineNode.py
+++ b/cura/Machines/MachineNode.py
@@ -19,7 +19,7 @@ import UM.FlameProfiler
class MachineNode(ContainerNode):
"""This class represents a machine in the container tree.
-
+
The subnodes of these nodes are variants.
"""
@@ -51,7 +51,7 @@ class MachineNode(ContainerNode):
def getQualityGroups(self, variant_names: List[str], material_bases: List[str], extruder_enabled: List[bool]) -> Dict[str, QualityGroup]:
"""Get the available quality groups for this machine.
-
+
This returns all quality groups, regardless of whether they are available to the combination of extruders or
not. On the resulting quality groups, the is_available property is set to indicate whether the quality group
can be selected according to the combination of extruders in the parameters.
@@ -103,13 +103,13 @@ class MachineNode(ContainerNode):
def getQualityChangesGroups(self, variant_names: List[str], material_bases: List[str], extruder_enabled: List[bool]) -> List[QualityChangesGroup]:
"""Returns all of the quality changes groups available to this printer.
-
+
The quality changes groups store which quality type and intent category they were made for, but not which
material and nozzle. Instead for the quality type and intent category, the quality changes will always be
available but change the quality type and intent category when activated.
-
+
The quality changes group does depend on the printer: Which quality definition is used.
-
+
The quality changes groups that are available do depend on the quality types that are available, so it must
still be known which extruders are enabled and which materials and variants are loaded in them. This allows
setting the correct is_available flag.
@@ -150,7 +150,7 @@ class MachineNode(ContainerNode):
def preferredGlobalQuality(self) -> "QualityNode":
"""Gets the preferred global quality node, going by the preferred quality type.
-
+
If the preferred global quality is not in there, an arbitrary global quality is taken. If there are no global
qualities, an empty quality is returned.
"""
diff --git a/cura/Machines/MaterialGroup.py b/cura/Machines/MaterialGroup.py
index bce7b410c3..2ff4b99c80 100644
--- a/cura/Machines/MaterialGroup.py
+++ b/cura/Machines/MaterialGroup.py
@@ -9,17 +9,17 @@ if TYPE_CHECKING:
class MaterialGroup:
"""A MaterialGroup represents a group of material InstanceContainers that are derived from a single material profile.
-
+
The main InstanceContainer which has the ID of the material profile file name is called the "root_material". For
example: "generic_abs" is the root material (ID) of "generic_abs_ultimaker3" and "generic_abs_ultimaker3_AA_0.4",
and "generic_abs_ultimaker3" and "generic_abs_ultimaker3_AA_0.4" are derived materials of "generic_abs".
-
+
Using "generic_abs" as an example, the MaterialGroup for "generic_abs" will contain the following information:
- name: "generic_abs", root_material_id
- root_material_node: MaterialNode of "generic_abs"
- derived_material_node_list: A list of MaterialNodes that are derived from "generic_abs", so
"generic_abs_ultimaker3", "generic_abs_ultimaker3_AA_0.4", etc.
-
+
"""
__slots__ = ("name", "is_read_only", "root_material_node", "derived_material_node_list")
diff --git a/cura/Machines/MaterialNode.py b/cura/Machines/MaterialNode.py
index 333452cc01..c78c6aff03 100644
--- a/cura/Machines/MaterialNode.py
+++ b/cura/Machines/MaterialNode.py
@@ -17,7 +17,7 @@ if TYPE_CHECKING:
class MaterialNode(ContainerNode):
"""Represents a material in the container tree.
-
+
Its subcontainers are quality profiles.
"""
@@ -38,7 +38,7 @@ class MaterialNode(ContainerNode):
def preferredQuality(self) -> QualityNode:
"""Finds the preferred quality for this printer with this material and this variant loaded.
-
+
If the preferred quality is not available, an arbitrary quality is returned. If there is a configuration
mistake (like a typo in the preferred quality) this returns a random available quality. If there are no
available qualities, this will return the empty quality node.
diff --git a/cura/Machines/Models/BaseMaterialsModel.py b/cura/Machines/Models/BaseMaterialsModel.py
index bc903da698..97f1f4b646 100644
--- a/cura/Machines/Models/BaseMaterialsModel.py
+++ b/cura/Machines/Models/BaseMaterialsModel.py
@@ -15,7 +15,7 @@ from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
class BaseMaterialsModel(ListModel):
"""This is the base model class for GenericMaterialsModel and MaterialBrandsModel.
-
+
Those 2 models are used by the material drop down menu to show generic materials and branded materials
separately. The extruder position defined here is being used to bound a menu to the correct extruder. This is
used in the top bar menu "Settings" -> "Extruder nr" -> "Material" -> this menu
@@ -125,7 +125,7 @@ class BaseMaterialsModel(ListModel):
def _materialsListChanged(self, material: MaterialNode) -> None:
"""Triggered when a list of materials changed somewhere in the container
-
+
tree. This change may trigger an _update() call when the materials changed for the configuration that this
model is looking for.
"""
diff --git a/cura/Machines/Models/DiscoveredPrintersModel.py b/cura/Machines/Models/DiscoveredPrintersModel.py
index 4042d4ae17..459ec4d795 100644
--- a/cura/Machines/Models/DiscoveredPrintersModel.py
+++ b/cura/Machines/Models/DiscoveredPrintersModel.py
@@ -212,7 +212,7 @@ class DiscoveredPrintersModel(QObject):
@pyqtProperty("QVariantMap", notify = discoveredPrintersChanged)
def discoveredPrintersByAddress(self) -> Dict[str, DiscoveredPrinter]:
return self._discovered_printer_by_ip_dict
-
+
@pyqtProperty("QVariantList", notify = discoveredPrintersChanged)
def discoveredPrinters(self) -> List["DiscoveredPrinter"]:
item_list = list(
diff --git a/cura/Machines/Models/ExtrudersModel.py b/cura/Machines/Models/ExtrudersModel.py
index 942799cf43..98865ed37e 100644
--- a/cura/Machines/Models/ExtrudersModel.py
+++ b/cura/Machines/Models/ExtrudersModel.py
@@ -17,7 +17,7 @@ catalog = i18nCatalog("cura")
class ExtrudersModel(ListModel):
"""Model that holds extruders.
-
+
This model is designed for use by any list of extruders, but specifically intended for drop-down lists of the
current machine's extruders in place of settings.
"""
@@ -33,7 +33,7 @@ class ExtrudersModel(ListModel):
IndexRole = Qt.UserRole + 4
"""Index of the extruder, which is also the value of the setting itself.
-
+
An index of 0 indicates the first extruder, an index of 1 the second one, and so on. This is the value that will
be saved in instance containers. """
@@ -58,7 +58,7 @@ class ExtrudersModel(ListModel):
def __init__(self, parent = None):
"""Initialises the extruders model, defining the roles and listening for changes in the data.
-
+
:param parent: Parent QtObject of this list.
"""
@@ -104,7 +104,7 @@ class ExtrudersModel(ListModel):
def _extrudersChanged(self, machine_id = None):
"""Links to the stack-changed signal of the new extruders when an extruder is swapped out or added in the
current machine.
-
+
:param machine_id: The machine for which the extruders changed. This is filled by the
ExtruderManager.extrudersChanged signal when coming from that signal. Application.globalContainerStackChanged
doesn't fill this signal; it's assumed to be the current printer in that case.
@@ -150,7 +150,7 @@ class ExtrudersModel(ListModel):
@UM.FlameProfiler.profile
def __updateExtruders(self):
"""Update the list of extruders.
-
+
This should be called whenever the list of extruders changes.
"""
diff --git a/cura/Machines/Models/IntentCategoryModel.py b/cura/Machines/Models/IntentCategoryModel.py
index d8502a7574..09a71b8ed6 100644
--- a/cura/Machines/Models/IntentCategoryModel.py
+++ b/cura/Machines/Models/IntentCategoryModel.py
@@ -57,7 +57,7 @@ class IntentCategoryModel(ListModel):
def __init__(self, intent_category: str) -> None:
"""Creates a new model for a certain intent category.
-
+
:param intent_category: category to list the intent profiles for.
"""
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py
index d18b040936..4a696ec974 100644
--- a/cura/Machines/Models/MaterialManagementModel.py
+++ b/cura/Machines/Models/MaterialManagementModel.py
@@ -21,20 +21,20 @@ catalog = i18nCatalog("cura")
class MaterialManagementModel(QObject):
"""Proxy class to the materials page in the preferences.
-
+
This class handles the actions in that page, such as creating new materials, renaming them, etc.
"""
favoritesChanged = pyqtSignal(str)
"""Triggered when a favorite is added or removed.
-
+
:param The base file of the material is provided as parameter when this emits
"""
@pyqtSlot("QVariant", result = bool)
def canMaterialBeRemoved(self, material_node: "MaterialNode") -> bool:
"""Can a certain material be deleted, or is it still in use in one of the container stacks anywhere?
-
+
We forbid the user from deleting a material if it's in use in any stack. Deleting it while it's in use can
lead to corrupted stacks. In the future we might enable this functionality again (deleting the material from
those stacks) but for now it is easier to prevent the user from doing this.
@@ -54,7 +54,7 @@ class MaterialManagementModel(QObject):
@pyqtSlot("QVariant", str)
def setMaterialName(self, material_node: "MaterialNode", name: str) -> None:
"""Change the user-visible name of a material.
-
+
:param material_node: The ContainerTree node of the material to rename.
:param name: The new name for the material.
"""
@@ -69,7 +69,7 @@ class MaterialManagementModel(QObject):
@pyqtSlot("QVariant")
def removeMaterial(self, material_node: "MaterialNode") -> None:
"""Deletes a material from Cura.
-
+
This function does not do any safety checking any more. Please call this function only if:
- The material is not read-only.
- The material is not used in any stacks.
@@ -200,7 +200,7 @@ class MaterialManagementModel(QObject):
def createMaterial(self) -> str:
"""Create a new material by cloning the preferred material for the current material diameter and generate a new
GUID.
-
+
The material type is explicitly left to be the one from the preferred material, since this allows the user to
still have SOME profiles to work with.
@@ -234,7 +234,7 @@ class MaterialManagementModel(QObject):
@pyqtSlot(str)
def addFavorite(self, material_base_file: str) -> None:
"""Adds a certain material to the favorite materials.
-
+
:param material_base_file: The base file of the material to add.
"""
@@ -249,7 +249,7 @@ class MaterialManagementModel(QObject):
@pyqtSlot(str)
def removeFavorite(self, material_base_file: str) -> None:
"""Removes a certain material from the favorite materials.
-
+
If the material was not in the favorite materials, nothing happens.
"""
diff --git a/cura/Machines/Models/QualityManagementModel.py b/cura/Machines/Models/QualityManagementModel.py
index 6dfed60f7b..039f45181f 100644
--- a/cura/Machines/Models/QualityManagementModel.py
+++ b/cura/Machines/Models/QualityManagementModel.py
@@ -76,7 +76,7 @@ class QualityManagementModel(ListModel):
@pyqtSlot(QObject)
def removeQualityChangesGroup(self, quality_changes_group: "QualityChangesGroup") -> None:
"""Deletes a custom profile. It will be gone forever.
-
+
:param quality_changes_group: The quality changes group representing the profile to delete.
"""
@@ -99,7 +99,7 @@ class QualityManagementModel(ListModel):
@pyqtSlot(QObject, str, result = str)
def renameQualityChangesGroup(self, quality_changes_group: "QualityChangesGroup", new_name: str) -> str:
"""Rename a custom profile.
-
+
Because the names must be unique, the new name may not actually become the name that was given. The actual
name is returned by this function.
@@ -145,7 +145,7 @@ class QualityManagementModel(ListModel):
@pyqtSlot(str, "QVariantMap")
def duplicateQualityChanges(self, new_name: str, quality_model_item: Dict[str, Any]) -> None:
"""Duplicates a given quality profile OR quality changes profile.
-
+
:param new_name: The desired name of the new profile. This will be made unique, so it might end up with a
different name.
:param quality_model_item: The item of this model to duplicate, as dictionary. See the descriptions of the
@@ -180,7 +180,7 @@ class QualityManagementModel(ListModel):
@pyqtSlot(str)
def createQualityChanges(self, base_name: str) -> None:
"""Create quality changes containers from the user containers in the active stacks.
-
+
This will go through the global and extruder stacks and create quality_changes containers from the user
containers in each stack. These then replace the quality_changes containers in the stack and clear the user
settings.
@@ -229,7 +229,7 @@ class QualityManagementModel(ListModel):
def _createQualityChanges(self, quality_type: str, intent_category: Optional[str], new_name: str, machine: "GlobalStack", extruder_stack: Optional["ExtruderStack"]) -> "InstanceContainer":
"""Create a quality changes container with the given set-up.
-
+
:param quality_type: The quality type of the new container.
:param intent_category: The intent category of the new container.
:param new_name: The name of the container. This name must be unique.
@@ -264,7 +264,7 @@ class QualityManagementModel(ListModel):
def _qualityChangesListChanged(self, container: "ContainerInterface") -> None:
"""Triggered when any container changed.
-
+
This filters the updates to the container manager: When it applies to the list of quality changes, we need to
update our list.
"""
@@ -383,7 +383,7 @@ class QualityManagementModel(ListModel):
The convenience meta-filters "All Supported Types" and "All Files" are added when listing readers,
but not when listing writers.
-
+
:param io_type: name of the needed IO type
:return: A list of strings indicating file name filters for a file dialog.
@@ -408,7 +408,7 @@ class QualityManagementModel(ListModel):
def _getIOPlugins(self, io_type):
"""Gets a list of profile reader or writer plugins
-
+
:return: List of tuples of (plugin_id, meta_data).
"""
from UM.PluginRegistry import PluginRegistry
diff --git a/cura/Machines/QualityChangesGroup.py b/cura/Machines/QualityChangesGroup.py
index ecaaa67b7a..668fff785a 100644
--- a/cura/Machines/QualityChangesGroup.py
+++ b/cura/Machines/QualityChangesGroup.py
@@ -8,7 +8,7 @@ from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
class QualityChangesGroup(QObject):
"""Data struct to group several quality changes instance containers together.
-
+
Each group represents one "custom profile" as the user sees it, which contains an instance container for the
global stack and one instance container per extruder.
"""
diff --git a/cura/Machines/QualityGroup.py b/cura/Machines/QualityGroup.py
index 8e470e0102..2e5e8db905 100644
--- a/cura/Machines/QualityGroup.py
+++ b/cura/Machines/QualityGroup.py
@@ -12,7 +12,7 @@ from cura.Machines.ContainerNode import ContainerNode
class QualityGroup:
"""A QualityGroup represents a group of quality containers that must be applied to each ContainerStack when it's
used.
-
+
A concrete example: When there are two extruders and the user selects the quality type "normal", this quality
type must be applied to all stacks in a machine, although each stack can have different containers. So one global
profile gets put on the global stack and one extruder profile gets put on each extruder stack. This quality group
@@ -24,7 +24,7 @@ class QualityGroup:
- um3_global_normal
- um3_aa04_pla_normal
- um3_aa04_abs_normal
-
+
The purpose of these quality groups is to group the containers that can be applied to a configuration,
so that when a quality level is selected, the container can directly be applied to each stack instead of looking
them up again.
@@ -32,7 +32,7 @@ class QualityGroup:
def __init__(self, name: str, quality_type: str) -> None:
"""Constructs a new group.
-
+
:param name: The user-visible name for the group.
:param quality_type: The quality level that each profile in this group has.
"""
diff --git a/cura/Machines/QualityNode.py b/cura/Machines/QualityNode.py
index 85e55c7a2d..dcbe486952 100644
--- a/cura/Machines/QualityNode.py
+++ b/cura/Machines/QualityNode.py
@@ -15,9 +15,9 @@ if TYPE_CHECKING:
class QualityNode(ContainerNode):
"""Represents a quality profile in the container tree.
-
+
This may either be a normal quality profile or a global quality profile.
-
+
Its subcontainers are intent profiles.
"""
diff --git a/cura/Machines/VariantNode.py b/cura/Machines/VariantNode.py
index 72372b5a45..39664946a3 100644
--- a/cura/Machines/VariantNode.py
+++ b/cura/Machines/VariantNode.py
@@ -19,9 +19,9 @@ if TYPE_CHECKING:
class VariantNode(ContainerNode):
"""This class represents an extruder variant in the container tree.
-
+
The subnodes of these nodes are materials.
-
+
This node contains materials with ALL filament diameters underneath it. The tree of this variant is not specific
to one global stack, so because the list of materials can be different per stack depending on the compatible
material diameter setting, we cannot filter them here. Filtering must be done in the model.
@@ -72,7 +72,7 @@ class VariantNode(ContainerNode):
def preferredMaterial(self, approximate_diameter: int) -> MaterialNode:
"""Finds the preferred material for this printer with this nozzle in one of the extruders.
-
+
If the preferred material is not available, an arbitrary material is returned. If there is a configuration
mistake (like a typo in the preferred material) this returns a random available material. If there are no
available materials, this will return the empty material node.
@@ -85,14 +85,14 @@ class VariantNode(ContainerNode):
for base_material, material_node in self.materials.items():
if self.machine.preferred_material == base_material and approximate_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
return material_node
-
+
# First fallback: Check if we should be checking for the 175 variant.
if approximate_diameter == 2:
preferred_material = self.machine.preferred_material + "_175"
for base_material, material_node in self.materials.items():
if preferred_material == base_material and approximate_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
return material_node
-
+
# Second fallback: Choose any material with matching diameter.
for material_node in self.materials.values():
if material_node.getMetaDataEntry("approximate_diameter") and approximate_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py
index 612c00de2f..e825afd2a9 100644
--- a/cura/OAuth2/AuthorizationHelpers.py
+++ b/cura/OAuth2/AuthorizationHelpers.py
@@ -31,12 +31,12 @@ class AuthorizationHelpers:
def getAccessTokenUsingAuthorizationCode(self, authorization_code: str, verification_code: str) -> "AuthenticationResponse":
"""Request the access token from the authorization server.
-
+
:param authorization_code: The authorization code from the 1st step.
:param verification_code: The verification code needed for the PKCE extension.
:return: An AuthenticationResponse object.
"""
-
+
data = {
"client_id": self._settings.CLIENT_ID if self._settings.CLIENT_ID is not None else "",
"redirect_uri": self._settings.CALLBACK_URL if self._settings.CALLBACK_URL is not None else "",
@@ -52,11 +52,11 @@ class AuthorizationHelpers:
def getAccessTokenUsingRefreshToken(self, refresh_token: str) -> "AuthenticationResponse":
"""Request the access token from the authorization server using a refresh token.
-
+
:param refresh_token:
:return: An AuthenticationResponse object.
"""
-
+
Logger.log("d", "Refreshing the access token.")
data = {
"client_id": self._settings.CLIENT_ID if self._settings.CLIENT_ID is not None else "",
@@ -73,11 +73,11 @@ class AuthorizationHelpers:
@staticmethod
def parseTokenResponse(token_response: requests.models.Response) -> "AuthenticationResponse":
"""Parse the token response from the authorization server into an AuthenticationResponse object.
-
+
:param token_response: The JSON string data response from the authorization server.
:return: An AuthenticationResponse object.
"""
-
+
token_data = None
try:
@@ -101,11 +101,11 @@ class AuthorizationHelpers:
def parseJWT(self, access_token: str) -> Optional["UserProfile"]:
"""Calls the authentication API endpoint to get the token data.
-
+
:param access_token: The encoded JWT token.
:return: Dict containing some profile data.
"""
-
+
try:
token_request = requests.get("{}/check-token".format(self._settings.OAUTH_SERVER_URL), headers = {
"Authorization": "Bearer {}".format(access_token)
@@ -130,20 +130,20 @@ class AuthorizationHelpers:
@staticmethod
def generateVerificationCode(code_length: int = 32) -> str:
"""Generate a verification code of arbitrary length.
-
+
:param code_length:: How long should the code be? This should never be lower than 16, but it's probably
better to leave it at 32
"""
-
+
return "".join(random.choice("0123456789ABCDEF") for i in range(code_length))
@staticmethod
def generateVerificationCodeChallenge(verification_code: str) -> str:
"""Generates a base64 encoded sha512 encrypted version of a given string.
-
+
:param verification_code:
:return: The encrypted code in base64 format.
"""
-
+
encoded = sha512(verification_code.encode()).digest()
return b64encode(encoded, altchars = b"_-").decode()
diff --git a/cura/OAuth2/AuthorizationRequestHandler.py b/cura/OAuth2/AuthorizationRequestHandler.py
index 9bcfbfc805..c7ce9b6faf 100644
--- a/cura/OAuth2/AuthorizationRequestHandler.py
+++ b/cura/OAuth2/AuthorizationRequestHandler.py
@@ -16,10 +16,10 @@ catalog = i18nCatalog("cura")
class AuthorizationRequestHandler(BaseHTTPRequestHandler):
"""This handler handles all HTTP requests on the local web server.
-
+
It also requests the access token for the 2nd stage of the OAuth flow.
"""
-
+
def __init__(self, request, client_address, server) -> None:
super().__init__(request, client_address, server)
@@ -60,11 +60,11 @@ class AuthorizationRequestHandler(BaseHTTPRequestHandler):
def _handleCallback(self, query: Dict[Any, List]) -> Tuple[ResponseData, Optional[AuthenticationResponse]]:
"""Handler for the callback URL redirect.
-
+
:param query: Dict containing the HTTP query parameters.
:return: HTTP ResponseData containing a success page to show to the user.
"""
-
+
code = self._queryGet(query, "code")
state = self._queryGet(query, "state")
if state != self.state:
diff --git a/cura/OAuth2/AuthorizationRequestServer.py b/cura/OAuth2/AuthorizationRequestServer.py
index e2f9dddc32..74b0b5f012 100644
--- a/cura/OAuth2/AuthorizationRequestServer.py
+++ b/cura/OAuth2/AuthorizationRequestServer.py
@@ -11,11 +11,11 @@ if TYPE_CHECKING:
class AuthorizationRequestServer(HTTPServer):
"""The authorization request callback handler server.
-
+
This subclass is needed to be able to pass some data to the request handler. This cannot be done on the request
handler directly as the HTTPServer creates an instance of the handler after init.
"""
-
+
def setAuthorizationHelpers(self, authorization_helpers: "AuthorizationHelpers") -> None:
"""Set the authorization helpers instance on the request handler."""
diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py
index 9b0fcba1ba..9a5c81ae55 100644
--- a/cura/OAuth2/AuthorizationService.py
+++ b/cura/OAuth2/AuthorizationService.py
@@ -251,7 +251,7 @@ class AuthorizationService:
if self._preferences is None:
Logger.log("e", "Unable to save authentication data, since no preference has been set!")
return
-
+
self._auth_data = auth_data
if auth_data:
self._user_profile = self.getUserProfile()
diff --git a/cura/OAuth2/LocalAuthorizationServer.py b/cura/OAuth2/LocalAuthorizationServer.py
index 942967301a..f819042ae0 100644
--- a/cura/OAuth2/LocalAuthorizationServer.py
+++ b/cura/OAuth2/LocalAuthorizationServer.py
@@ -24,19 +24,19 @@ class LocalAuthorizationServer:
auth_state_changed_callback: Callable[["AuthenticationResponse"], Any],
daemon: bool) -> None:
"""The local LocalAuthorizationServer takes care of the oauth2 callbacks.
-
+
Once the flow is completed, this server should be closed down again by calling
:py:meth:`cura.OAuth2.LocalAuthorizationServer.LocalAuthorizationServer.stop()`
-
+
:param auth_helpers: An instance of the authorization helpers class.
:param auth_state_changed_callback: A callback function to be called when the authorization state changes.
:param daemon: Whether the server thread should be run in daemon mode.
-
+
.. note::
-
+
Daemon threads are abruptly stopped at shutdown. Their resources (e.g. open files) may never be released.
"""
-
+
self._web_server = None # type: Optional[AuthorizationRequestServer]
self._web_server_thread = None # type: Optional[threading.Thread]
self._web_server_port = auth_helpers.settings.CALLBACK_PORT
@@ -46,11 +46,11 @@ class LocalAuthorizationServer:
def start(self, verification_code: str, state: str) -> None:
"""Starts the local web server to handle the authorization callback.
-
+
:param verification_code: The verification code part of the OAuth2 client identification.
:param state: The unique state code (to ensure that the request we get back is really from the server.
"""
-
+
if self._web_server:
# If the server is already running (because of a previously aborted auth flow), we don't have to start it.
# We still inject the new verification code though.
diff --git a/cura/OneAtATimeIterator.py b/cura/OneAtATimeIterator.py
index 4853cffcc1..def0dac4fe 100644
--- a/cura/OneAtATimeIterator.py
+++ b/cura/OneAtATimeIterator.py
@@ -9,7 +9,7 @@ from functools import cmp_to_key
class OneAtATimeIterator(Iterator.Iterator):
"""Iterator that returns a list of nodes in the order that they need to be printed
-
+
If there is no solution an empty list is returned.
Take note that the list of nodes can have children (that may or may not contain mesh data)
"""
@@ -80,7 +80,7 @@ class OneAtATimeIterator(Iterator.Iterator):
def _checkBlockMultiple(self, node: SceneNode, other_nodes: List[SceneNode]) -> bool:
"""Check for a node whether it hits any of the other nodes.
-
+
:param node: The node to check whether it collides with the other nodes.
:param other_nodes: The nodes to check for collisions.
:return: returns collision between nodes
@@ -140,7 +140,7 @@ class _ObjectOrder:
def __init__(self, order: List[SceneNode], todo: List[SceneNode]) -> None:
"""Creates the _ObjectOrder instance.
-
+
:param order: List of indices in which to print objects, ordered by printing order.
:param todo: List of indices which are not yet inserted into the order list.
"""
diff --git a/cura/Operations/SetParentOperation.py b/cura/Operations/SetParentOperation.py
index 52bef4aabc..a8fab49395 100644
--- a/cura/Operations/SetParentOperation.py
+++ b/cura/Operations/SetParentOperation.py
@@ -11,7 +11,7 @@ class SetParentOperation(Operation.Operation):
def __init__(self, node: SceneNode, parent_node: Optional[SceneNode]) -> None:
"""Initialises this SetParentOperation.
-
+
:param node: The node which will be reparented.
:param parent_node: The node which will be the parent.
"""
@@ -33,7 +33,7 @@ class SetParentOperation(Operation.Operation):
def _set_parent(self, new_parent: Optional[SceneNode]) -> None:
"""Sets the parent of the node while applying transformations to the world-transform of the node stays the same.
-
+
:param new_parent: The new parent. Note: this argument can be None, which would hide the node from the scene.
"""
@@ -64,7 +64,7 @@ class SetParentOperation(Operation.Operation):
def __repr__(self) -> str:
"""Returns a programmer-readable representation of this operation.
-
+
:return: A programmer-readable representation of this operation.
"""
diff --git a/cura/PickingPass.py b/cura/PickingPass.py
index 8fd411807d..13a115f64b 100644
--- a/cura/PickingPass.py
+++ b/cura/PickingPass.py
@@ -21,9 +21,9 @@ if TYPE_CHECKING:
class PickingPass(RenderPass):
"""A :py:class:`Uranium.UM.View.RenderPass` subclass that renders a the distance of selectable objects from the
active camera to a texture.
-
+
The texture is used to map a 2d location (eg the mouse location) to a world space position
-
+
.. note:: that in order to increase precision, the 24 bit depth value is encoded into all three of the R,G & B channels
"""
diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py
index 015795e506..5fd2e70a1c 100755
--- a/cura/PlatformPhysics.py
+++ b/cura/PlatformPhysics.py
@@ -95,15 +95,15 @@ class PlatformPhysics:
# Ignore root, ourselves and anything that is not a normal SceneNode.
if other_node is root or not issubclass(type(other_node), SceneNode) or other_node is node or other_node.callDecoration("getBuildPlateNumber") != node.callDecoration("getBuildPlateNumber"):
continue
-
+
# Ignore collisions of a group with it's own children
if other_node in node.getAllChildren() or node in other_node.getAllChildren():
continue
-
+
# Ignore collisions within a group
if other_node.getParent() and node.getParent() and (other_node.getParent().callDecoration("isGroup") is not None or node.getParent().callDecoration("isGroup") is not None):
continue
-
+
# Ignore nodes that do not have the right properties set.
if not other_node.callDecoration("getConvexHull") or not other_node.getBoundingBox():
continue
diff --git a/cura/PreviewPass.py b/cura/PreviewPass.py
index 9e7c2c49fc..9cae5ad9bd 100644
--- a/cura/PreviewPass.py
+++ b/cura/PreviewPass.py
@@ -39,9 +39,9 @@ def prettier_color(color_list: List[float]) -> List[float]:
class PreviewPass(RenderPass):
"""A :py:class:`Uranium.UM.View.RenderPass` subclass that renders slicable objects with default parameters.
-
+
It uses the active camera by default, but it can be overridden to use a different camera.
-
+
This is useful to get a preview image of a scene taken from a different location as the active camera.
"""
diff --git a/cura/PrinterOutput/FirmwareUpdater.py b/cura/PrinterOutput/FirmwareUpdater.py
index 2794bf5c65..8688c5a623 100644
--- a/cura/PrinterOutput/FirmwareUpdater.py
+++ b/cura/PrinterOutput/FirmwareUpdater.py
@@ -36,7 +36,7 @@ class FirmwareUpdater(QObject):
if self._firmware_file == "":
self._setFirmwareUpdateState(FirmwareUpdateState.firmware_not_found_error)
return
-
+
self._setFirmwareUpdateState(FirmwareUpdateState.updating)
self._update_firmware_thread.start()
diff --git a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py
index b80a652163..ecc855ab8f 100644
--- a/cura/PrinterOutput/Models/ExtruderConfigurationModel.py
+++ b/cura/PrinterOutput/Models/ExtruderConfigurationModel.py
@@ -49,7 +49,7 @@ class ExtruderConfigurationModel(QObject):
def isValid(self) -> bool:
"""This method is intended to indicate whether the configuration is valid or not.
-
+
The method checks if the mandatory fields are or not set
At this moment is always valid since we allow to have empty material and variants.
"""
diff --git a/cura/PrinterOutput/Models/ExtruderOutputModel.py b/cura/PrinterOutput/Models/ExtruderOutputModel.py
index 9e74e9520c..9da3a7117d 100644
--- a/cura/PrinterOutput/Models/ExtruderOutputModel.py
+++ b/cura/PrinterOutput/Models/ExtruderOutputModel.py
@@ -106,7 +106,7 @@ class ExtruderOutputModel(QObject):
@pyqtSlot(float, float)
def preheatHotend(self, temperature: float, duration: float) -> None:
"""Pre-heats the extruder before printer.
-
+
:param temperature: The temperature to heat the extruder to, in degrees
Celsius.
:param duration: How long the bed should stay warm, in seconds.
diff --git a/cura/PrinterOutput/Models/PrinterConfigurationModel.py b/cura/PrinterOutput/Models/PrinterConfigurationModel.py
index c5aa949ff3..54f52134b2 100644
--- a/cura/PrinterOutput/Models/PrinterConfigurationModel.py
+++ b/cura/PrinterOutput/Models/PrinterConfigurationModel.py
@@ -50,7 +50,7 @@ class PrinterConfigurationModel(QObject):
def isValid(self) -> bool:
"""This method is intended to indicate whether the configuration is valid or not.
-
+
The method checks if the mandatory fields are or not set
"""
if not self._extruder_configurations:
@@ -101,7 +101,7 @@ class PrinterConfigurationModel(QObject):
def __hash__(self):
"""The hash function is used to compare and create unique sets. The configuration is unique if the configuration
-
+
of the extruders is unique (the order of the extruders matters), and the type and buildplate is the same.
"""
extruder_hash = hash(0)
diff --git a/cura/PrinterOutput/Models/PrinterOutputModel.py b/cura/PrinterOutput/Models/PrinterOutputModel.py
index 8b716a1958..37464b0b7d 100644
--- a/cura/PrinterOutput/Models/PrinterOutputModel.py
+++ b/cura/PrinterOutput/Models/PrinterOutputModel.py
@@ -166,7 +166,7 @@ class PrinterOutputModel(QObject):
@pyqtSlot(float, float)
def preheatBed(self, temperature: float, duration: float) -> None:
"""Pre-heats the heated bed of the printer.
-
+
:param temperature: The temperature to heat the bed to, in degrees
Celsius.
:param duration: How long the bed should stay warm, in seconds.
diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py
index e57e461dde..2690c2651f 100644
--- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py
+++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py
@@ -147,7 +147,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
def createFormPart(self, content_header: str, data: bytes, content_type: Optional[str] = None) -> QHttpPart:
"""This method was only available privately before, but it was actually called from SendMaterialJob.py.
-
+
We now have a public equivalent as well. We did not remove the private one as plugins might be using that.
"""
return self._createFormPart(content_header, data, content_type)
@@ -194,7 +194,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
on_finished: Optional[Callable[[QNetworkReply], None]] = None,
on_progress: Optional[Callable[[int, int], None]] = None) -> None:
"""Sends a put request to the given path.
-
+
:param url: The path after the API prefix.
:param data: The data to be sent in the body
:param content_type: The content type of the body data.
@@ -219,7 +219,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
def delete(self, url: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:
"""Sends a delete request to the given path.
-
+
:param url: The path after the API prefix.
:param on_finished: The function to be call when the response is received.
"""
@@ -237,7 +237,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
def get(self, url: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None:
"""Sends a get request to the given path.
-
+
:param url: The path after the API prefix.
:param on_finished: The function to be call when the response is received.
"""
@@ -258,7 +258,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
on_progress: Optional[Callable[[int, int], None]] = None) -> None:
"""Sends a post request to the given path.
-
+
:param url: The path after the API prefix.
:param data: The data to be sent in the body
:param on_finished: The function to call when the response is received.
@@ -333,7 +333,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
def _checkCorrectGroupName(self, device_id: str, group_name: str) -> None:
"""This method checks if the name of the group stored in the definition container is correct.
-
+
After updating from 3.2 to 3.3 some group names may be temporary. If there is a mismatch in the name of the group
then all the container stacks are updated, both the current and the hidden ones.
"""
@@ -385,7 +385,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
@pyqtProperty(str, constant = True)
def key(self) -> str:
"""Get the unique key of this machine
-
+
:return: key String containing the key of the machine.
"""
return self._id
diff --git a/cura/PrinterOutput/Peripheral.py b/cura/PrinterOutput/Peripheral.py
index e9a283ba2b..27d127832b 100644
--- a/cura/PrinterOutput/Peripheral.py
+++ b/cura/PrinterOutput/Peripheral.py
@@ -4,7 +4,7 @@
class Peripheral:
"""Data class that represents a peripheral for a printer.
-
+
Output device plug-ins may specify that the printer has a certain set of
peripherals. This set is then possibly shown in the interface of the monitor
stage.
@@ -12,7 +12,7 @@ class Peripheral:
def __init__(self, peripheral_type: str, name: str) -> None:
"""Constructs the peripheral.
-
+
:param peripheral_type: A unique ID for the type of peripheral.
:param name: A human-readable name for the peripheral.
"""
diff --git a/cura/PrinterOutput/PrinterOutputDevice.py b/cura/PrinterOutput/PrinterOutputDevice.py
index 9b10e6abec..526d713748 100644
--- a/cura/PrinterOutput/PrinterOutputDevice.py
+++ b/cura/PrinterOutput/PrinterOutputDevice.py
@@ -44,13 +44,13 @@ class ConnectionType(IntEnum):
@signalemitter
class PrinterOutputDevice(QObject, OutputDevice):
"""Printer output device adds extra interface options on top of output device.
-
+
The assumption is made the printer is a FDM printer.
-
+
Note that a number of settings are marked as "final". This is because decorators
are not inherited by children. To fix this we use the private counter part of those
functions to actually have the implementation.
-
+
For all other uses it should be used in the same way as a "regular" OutputDevice.
"""
@@ -250,7 +250,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
def _setFirmwareName(self, name: str) -> None:
"""Set the device firmware name
-
+
:param name: The name of the firmware.
"""
@@ -258,7 +258,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
def getFirmwareName(self) -> Optional[str]:
"""Get the name of device firmware
-
+
This name can be used to define device type
"""
diff --git a/cura/ReaderWriters/ProfileReader.py b/cura/ReaderWriters/ProfileReader.py
index 3d80411713..0d53bdebac 100644
--- a/cura/ReaderWriters/ProfileReader.py
+++ b/cura/ReaderWriters/ProfileReader.py
@@ -12,7 +12,7 @@ class NoProfileException(Exception):
class ProfileReader(PluginObject):
"""A type of plug-ins that reads profiles from a file.
-
+
The profile is then stored as instance container of the type user profile.
"""
@@ -21,7 +21,7 @@ class ProfileReader(PluginObject):
def read(self, file_name):
"""Read profile data from a file and return a filled profile.
-
+
:return: :type{Profile|Profile[]} The profile that was obtained from the file or a list of Profiles.
"""
diff --git a/cura/ReaderWriters/ProfileWriter.py b/cura/ReaderWriters/ProfileWriter.py
index 0dd787335e..987924ccbf 100644
--- a/cura/ReaderWriters/ProfileWriter.py
+++ b/cura/ReaderWriters/ProfileWriter.py
@@ -6,13 +6,13 @@ from UM.PluginObject import PluginObject
class ProfileWriter(PluginObject):
"""Base class for profile writer plugins.
-
+
This class defines a write() function to write profiles to files with.
"""
def __init__(self):
"""Initialises the profile writer.
-
+
This currently doesn't do anything since the writer is basically static.
"""
@@ -20,9 +20,9 @@ class ProfileWriter(PluginObject):
def write(self, path, profiles):
"""Writes a profile to the specified file path.
-
+
The profile writer may write its own file format to the specified file.
-
+
:param path: :type{string} The file to output to.
:param profiles: :type{Profile} or :type{List} The profile(s) to write to the file.
:return: True if the writing was successful, or False if it wasn't.
diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py
index df496aa401..46caa5b9e0 100644
--- a/cura/Scene/ConvexHullDecorator.py
+++ b/cura/Scene/ConvexHullDecorator.py
@@ -25,7 +25,7 @@ if TYPE_CHECKING:
class ConvexHullDecorator(SceneNodeDecorator):
"""The convex hull decorator is a scene node decorator that adds the convex hull functionality to a scene node.
-
+
If a scene node has a convex hull decorator, it will have a shadow in which other objects can not be printed.
"""
@@ -84,7 +84,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getAdhesionArea(self) -> Optional[Polygon]:
"""The polygon representing the 2D adhesion area.
-
+
If no adhesion is used, the regular convex hull is returned
"""
if self._node is None:
@@ -98,7 +98,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getConvexHull(self) -> Optional[Polygon]:
"""Get the unmodified 2D projected convex hull of the node (if any)
-
+
In case of one-at-a-time, this includes adhesion and head+fans clearance
"""
if self._node is None:
@@ -118,7 +118,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getConvexHullHeadFull(self) -> Optional[Polygon]:
"""For one at the time this is the convex hull of the node with the full head size
-
+
In case of printing all at once this is None.
"""
if self._node is None:
@@ -138,7 +138,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getConvexHullHead(self) -> Optional[Polygon]:
"""Get convex hull of the object + head size
-
+
In case of printing all at once this is None.
For one at the time this is area with intersection of mirrored head
"""
@@ -156,7 +156,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getConvexHullBoundary(self) -> Optional[Polygon]:
"""Get convex hull of the node
-
+
In case of printing all at once this None??
For one at the time this is the area without the head.
"""
@@ -173,7 +173,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def getPrintingArea(self) -> Optional[Polygon]:
"""Get the buildplate polygon where will be printed
-
+
In case of printing all at once this is the same as convex hull (no individual adhesion)
For one at the time this includes the adhesion area
"""
@@ -344,7 +344,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def _add2DAdhesionMargin(self, poly: Polygon) -> Polygon:
"""Compensate given 2D polygon with adhesion margin
-
+
:return: 2D polygon with added margin
"""
if not self._global_stack:
@@ -379,7 +379,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
def _offsetHull(self, convex_hull: Polygon) -> Polygon:
"""Offset the convex hull with settings that influence the collision area.
-
+
:param convex_hull: Polygon of the original convex hull.
:return: New Polygon instance that is offset with everything that
influences the collision area.
@@ -476,6 +476,6 @@ class ConvexHullDecorator(SceneNodeDecorator):
_influencing_settings = {"xy_offset", "xy_offset_layer_0", "mold_enabled", "mold_width", "anti_overhang_mesh", "infill_mesh", "cutting_mesh"}
"""Settings that change the convex hull.
-
+
If these settings change, the convex hull should be recalculated.
"""
diff --git a/cura/Scene/ConvexHullNode.py b/cura/Scene/ConvexHullNode.py
index cd0951cba6..765dae26a2 100644
--- a/cura/Scene/ConvexHullNode.py
+++ b/cura/Scene/ConvexHullNode.py
@@ -20,7 +20,7 @@ class ConvexHullNode(SceneNode):
def __init__(self, node: SceneNode, hull: Optional[Polygon], thickness: float, parent: Optional[SceneNode] = None) -> None:
"""Convex hull node is a special type of scene node that is used to display an area, to indicate the
-
+
location an object uses on the buildplate. This area (or area's in case of one at a time printing) is
then displayed as a transparent shadow. If the adhesion type is set to raft, the area is extruded
to represent the raft as well.
diff --git a/cura/Scene/CuraSceneNode.py b/cura/Scene/CuraSceneNode.py
index b9f2279414..e7858a9633 100644
--- a/cura/Scene/CuraSceneNode.py
+++ b/cura/Scene/CuraSceneNode.py
@@ -17,7 +17,7 @@ from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator # F
class CuraSceneNode(SceneNode):
"""Scene nodes that are models are only seen when selecting the corresponding build plate
-
+
Note that many other nodes can just be UM SceneNode objects.
"""
def __init__(self, parent: Optional["SceneNode"] = None, visible: bool = True, name: str = "", no_setting_override: bool = False) -> None:
@@ -40,7 +40,7 @@ class CuraSceneNode(SceneNode):
def getPrintingExtruder(self) -> Optional[ExtruderStack]:
"""Get the extruder used to print this node. If there is no active node, then the extruder in position zero is returned
-
+
TODO The best way to do it is by adding the setActiveExtruder decorator to every node when is loaded
"""
global_container_stack = Application.getInstance().getGlobalContainerStack()
diff --git a/cura/Scene/SliceableObjectDecorator.py b/cura/Scene/SliceableObjectDecorator.py
index 982a38d667..ad51f7d755 100644
--- a/cura/Scene/SliceableObjectDecorator.py
+++ b/cura/Scene/SliceableObjectDecorator.py
@@ -4,7 +4,7 @@ from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
class SliceableObjectDecorator(SceneNodeDecorator):
def __init__(self) -> None:
super().__init__()
-
+
def isSliceable(self) -> bool:
return True
diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py
index 29be16dcce..e70e307079 100644
--- a/cura/Settings/ContainerManager.py
+++ b/cura/Settings/ContainerManager.py
@@ -35,7 +35,7 @@ catalog = i18nCatalog("cura")
class ContainerManager(QObject):
"""Manager class that contains common actions to deal with containers in Cura.
-
+
This is primarily intended as a class to be able to perform certain actions
from within QML. We want to be able to trigger things like removing a container
when a certain action happens. This can be done through this class.
@@ -72,16 +72,16 @@ class ContainerManager(QObject):
@pyqtSlot("QVariant", str, str)
def setContainerMetaDataEntry(self, container_node: "ContainerNode", entry_name: str, entry_value: str) -> bool:
"""Set a metadata entry of the specified container.
-
+
This will set the specified entry of the container's metadata to the specified
value. Note that entries containing dictionaries can have their entries changed
by using "/" as a separator. For example, to change an entry "foo" in a
dictionary entry "bar", you can specify "bar/foo" as entry name.
-
+
:param container_node: :type{ContainerNode}
:param entry_name: :type{str} The name of the metadata entry to change.
:param entry_value: The new value of the entry.
-
+
TODO: This is ONLY used by MaterialView for material containers. Maybe refactor this.
Update: In order for QML to use objects and sub objects, those (sub) objects must all be QObject. Is that what we want?
"""
@@ -131,14 +131,14 @@ class ContainerManager(QObject):
@pyqtSlot(str, result = "QStringList")
def getContainerNameFilters(self, type_name: str) -> List[str]:
"""Get a list of string that can be used as name filters for a Qt File Dialog
-
+
This will go through the list of available container types and generate a list of strings
out of that. The strings are formatted as "description (*.extension)" and can be directly
passed to a nameFilters property of a Qt File Dialog.
-
+
:param type_name: Which types of containers to list. These types correspond to the "type"
key of the plugin metadata.
-
+
:return: A string list with name filters.
"""
@@ -156,11 +156,11 @@ class ContainerManager(QObject):
@pyqtSlot(str, str, QUrl, result = "QVariantMap")
def exportContainer(self, container_id: str, file_type: str, file_url_or_string: Union[QUrl, str]) -> Dict[str, str]:
"""Export a container to a file
-
+
:param container_id: The ID of the container to export
:param file_type: The type of file to save as. Should be in the form of "description (*.extension, *.ext)"
:param file_url_or_string: The URL where to save the file.
-
+
:return: A dictionary containing a key "status" with a status code and a key "message" with a message
explaining the status. The status code can be one of "error", "cancelled", "success"
"""
@@ -224,9 +224,9 @@ class ContainerManager(QObject):
@pyqtSlot(QUrl, result = "QVariantMap")
def importMaterialContainer(self, file_url_or_string: Union[QUrl, str]) -> Dict[str, str]:
"""Imports a profile from a file
-
+
:param file_url: A URL that points to the file to import.
-
+
:return: :type{Dict} dict with a 'status' key containing the string 'success' or 'error', and a 'message' key
containing a message for the user
"""
@@ -278,10 +278,10 @@ class ContainerManager(QObject):
@pyqtSlot(result = bool)
def updateQualityChanges(self) -> bool:
"""Update the current active quality changes container with the settings from the user container.
-
+
This will go through the active global stack and all active extruder stacks and merge the changes from the user
container into the quality_changes container. After that, the user container is cleared.
-
+
:return: :type{bool} True if successful, False if not.
"""
@@ -350,7 +350,7 @@ class ContainerManager(QObject):
@pyqtSlot("QVariant", bool, result = "QStringList")
def getLinkedMaterials(self, material_node: "MaterialNode", exclude_self: bool = False) -> List[str]:
"""Get a list of materials that have the same GUID as the reference material
-
+
:param material_node: The node representing the material for which to get
the same GUID.
:param exclude_self: Whether to include the name of the material you provided.
@@ -366,7 +366,7 @@ class ContainerManager(QObject):
@pyqtSlot("QVariant")
def unlinkMaterial(self, material_node: "MaterialNode") -> None:
"""Unlink a material from all other materials by creating a new GUID
-
+
:param material_id: :type{str} the id of the material to create a new GUID for.
"""
# Get the material group
diff --git a/cura/Settings/CuraContainerStack.py b/cura/Settings/CuraContainerStack.py
index 1551e46ef2..36548ed5de 100755
--- a/cura/Settings/CuraContainerStack.py
+++ b/cura/Settings/CuraContainerStack.py
@@ -20,11 +20,11 @@ from . import Exceptions
class CuraContainerStack(ContainerStack):
"""Base class for Cura related stacks that want to enforce certain containers are available.
-
+
This class makes sure that the stack has the following containers set: user changes, quality
changes, quality, material, variant, definition changes and finally definition. Initially,
these will be equal to the empty instance container.
-
+
The container types are determined based on the following criteria:
- user: An InstanceContainer with the metadata entry "type" set to "user".
- quality changes: An InstanceContainer with the metadata entry "type" set to "quality_changes".
@@ -33,7 +33,7 @@ class CuraContainerStack(ContainerStack):
- variant: An InstanceContainer with the metadata entry "type" set to "variant".
- definition changes: An InstanceContainer with the metadata entry "type" set to "definition_changes".
- definition: A DefinitionContainer.
-
+
Internally, this class ensures the mentioned containers are always there and kept in a specific order.
This also means that operations on the stack that modifies the container ordering is prohibited and
will raise an exception.
@@ -65,7 +65,7 @@ class CuraContainerStack(ContainerStack):
def setUserChanges(self, new_user_changes: InstanceContainer) -> None:
"""Set the user changes container.
-
+
:param new_user_changes: The new user changes container. It is expected to have a "type" metadata entry with the value "user".
"""
@@ -74,7 +74,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setUserChanges, notify = pyqtContainersChanged)
def userChanges(self) -> InstanceContainer:
"""Get the user changes container.
-
+
:return: The user changes container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -82,7 +82,7 @@ class CuraContainerStack(ContainerStack):
def setQualityChanges(self, new_quality_changes: InstanceContainer, postpone_emit = False) -> None:
"""Set the quality changes container.
-
+
:param new_quality_changes: The new quality changes container. It is expected to have a "type" metadata entry with the value "quality_changes".
"""
@@ -91,7 +91,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setQualityChanges, notify = pyqtContainersChanged)
def qualityChanges(self) -> InstanceContainer:
"""Get the quality changes container.
-
+
:return: The quality changes container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -99,7 +99,7 @@ class CuraContainerStack(ContainerStack):
def setIntent(self, new_intent: InstanceContainer, postpone_emit: bool = False) -> None:
"""Set the intent container.
-
+
:param new_intent: The new intent container. It is expected to have a "type" metadata entry with the value "intent".
"""
@@ -108,7 +108,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setIntent, notify = pyqtContainersChanged)
def intent(self) -> InstanceContainer:
"""Get the quality container.
-
+
:return: The intent container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -116,7 +116,7 @@ class CuraContainerStack(ContainerStack):
def setQuality(self, new_quality: InstanceContainer, postpone_emit: bool = False) -> None:
"""Set the quality container.
-
+
:param new_quality: The new quality container. It is expected to have a "type" metadata entry with the value "quality".
"""
@@ -125,7 +125,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setQuality, notify = pyqtContainersChanged)
def quality(self) -> InstanceContainer:
"""Get the quality container.
-
+
:return: The quality container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -133,7 +133,7 @@ class CuraContainerStack(ContainerStack):
def setMaterial(self, new_material: InstanceContainer, postpone_emit: bool = False) -> None:
"""Set the material container.
-
+
:param new_material: The new material container. It is expected to have a "type" metadata entry with the value "material".
"""
@@ -142,7 +142,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setMaterial, notify = pyqtContainersChanged)
def material(self) -> InstanceContainer:
"""Get the material container.
-
+
:return: The material container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -150,7 +150,7 @@ class CuraContainerStack(ContainerStack):
def setVariant(self, new_variant: InstanceContainer) -> None:
"""Set the variant container.
-
+
:param new_variant: The new variant container. It is expected to have a "type" metadata entry with the value "variant".
"""
@@ -159,7 +159,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setVariant, notify = pyqtContainersChanged)
def variant(self) -> InstanceContainer:
"""Get the variant container.
-
+
:return: The variant container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -167,7 +167,7 @@ class CuraContainerStack(ContainerStack):
def setDefinitionChanges(self, new_definition_changes: InstanceContainer) -> None:
"""Set the definition changes container.
-
+
:param new_definition_changes: The new definition changes container. It is expected to have a "type" metadata entry with the value "definition_changes".
"""
@@ -176,7 +176,7 @@ class CuraContainerStack(ContainerStack):
@pyqtProperty(InstanceContainer, fset = setDefinitionChanges, notify = pyqtContainersChanged)
def definitionChanges(self) -> InstanceContainer:
"""Get the definition changes container.
-
+
:return: The definition changes container. Should always be a valid container, but can be equal to the empty InstanceContainer.
"""
@@ -184,7 +184,7 @@ class CuraContainerStack(ContainerStack):
def setDefinition(self, new_definition: DefinitionContainerInterface) -> None:
"""Set the definition container.
-
+
:param new_definition: The new definition container. It is expected to have a "type" metadata entry with the value "definition".
"""
@@ -206,10 +206,10 @@ class CuraContainerStack(ContainerStack):
@pyqtSlot(str, result = bool)
def hasUserValue(self, key: str) -> bool:
"""Check whether the specified setting has a 'user' value.
-
+
A user value here is defined as the setting having a value in either
the UserChanges or QualityChanges container.
-
+
:return: True if the setting has a user value, False if not.
"""
@@ -223,11 +223,11 @@ class CuraContainerStack(ContainerStack):
def setProperty(self, key: str, property_name: str, property_value: Any, container: "ContainerInterface" = None, set_from_cache: bool = False) -> None:
"""Set a property of a setting.
-
+
This will set a property of a specified setting. Since the container stack does not contain
any settings itself, it is required to specify a container to set the property on. The target
container is matched by container type.
-
+
:param key: The key of the setting to set.
:param property_name: The name of the property to set.
:param new_value: The new value to set the property to.
@@ -239,7 +239,7 @@ class CuraContainerStack(ContainerStack):
@override(ContainerStack)
def addContainer(self, container: ContainerInterface) -> None:
"""Overridden from ContainerStack
-
+
Since we have a fixed order of containers in the stack and this method would modify the container
ordering, we disallow this operation.
"""
@@ -249,7 +249,7 @@ class CuraContainerStack(ContainerStack):
@override(ContainerStack)
def insertContainer(self, index: int, container: ContainerInterface) -> None:
"""Overridden from ContainerStack
-
+
Since we have a fixed order of containers in the stack and this method would modify the container
ordering, we disallow this operation.
"""
@@ -259,7 +259,7 @@ class CuraContainerStack(ContainerStack):
@override(ContainerStack)
def removeContainer(self, index: int = 0) -> None:
"""Overridden from ContainerStack
-
+
Since we have a fixed order of containers in the stack and this method would modify the container
ordering, we disallow this operation.
"""
@@ -269,10 +269,10 @@ class CuraContainerStack(ContainerStack):
@override(ContainerStack)
def replaceContainer(self, index: int, container: ContainerInterface, postpone_emit: bool = False) -> None:
"""Overridden from ContainerStack
-
+
Replaces the container at the specified index with another container.
This version performs checks to make sure the new container has the expected metadata and type.
-
+
:throws Exception.InvalidContainerError Raised when trying to replace a container with a container that has an incorrect type.
"""
@@ -292,12 +292,12 @@ class CuraContainerStack(ContainerStack):
@override(ContainerStack)
def deserialize(self, serialized: str, file_name: Optional[str] = None) -> str:
"""Overridden from ContainerStack
-
+
This deserialize will make sure the internal list of containers matches with what we expect.
It will first check to see if the container at a certain index already matches with what we
expect. If it does not, it will search for a matching container with the correct type. Should
no container with the correct type be found, it will use the empty container.
-
+
:raise InvalidContainerStackError: Raised when no definition can be found for the stack.
"""
@@ -357,12 +357,12 @@ class CuraContainerStack(ContainerStack):
@classmethod
def _findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContainerInterface) -> str:
"""Find the ID that should be used when searching for instance containers for a specified definition.
-
+
This handles the situation where the definition specifies we should use a different definition when
searching for instance containers.
-
+
:param machine_definition: The definition to find the "quality definition" for.
-
+
:return: The ID of the definition container to use when searching for instance containers.
"""
diff --git a/cura/Settings/CuraStackBuilder.py b/cura/Settings/CuraStackBuilder.py
index 37469f95f7..2b71db8034 100644
--- a/cura/Settings/CuraStackBuilder.py
+++ b/cura/Settings/CuraStackBuilder.py
@@ -20,10 +20,10 @@ class CuraStackBuilder:
@classmethod
def createMachine(cls, name: str, definition_id: str) -> Optional[GlobalStack]:
"""Create a new instance of a machine.
-
+
:param name: The name of the new machine.
:param definition_id: The ID of the machine definition to use.
-
+
:return: The new global stack or None if an error occurred.
"""
@@ -77,7 +77,7 @@ class CuraStackBuilder:
@classmethod
def createExtruderStackWithDefaultSetup(cls, global_stack: "GlobalStack", extruder_position: int) -> None:
"""Create a default Extruder Stack
-
+
:param global_stack: The global stack this extruder refers to.
:param extruder_position: The position of the current extruder.
"""
@@ -134,7 +134,7 @@ class CuraStackBuilder:
quality_container: "InstanceContainer") -> ExtruderStack:
"""Create a new Extruder stack
-
+
:param new_stack_id: The ID of the new stack.
:param extruder_definition: The definition to base the new stack on.
:param machine_definition_id: The ID of the machine definition to use for the user container.
@@ -142,7 +142,7 @@ class CuraStackBuilder:
:param variant_container: The variant selected for the current extruder.
:param material_container: The material selected for the current extruder.
:param quality_container: The quality selected for the current extruder.
-
+
:return: A new Extruder stack instance with the specified parameters.
"""
@@ -181,13 +181,13 @@ class CuraStackBuilder:
quality_container: "InstanceContainer") -> GlobalStack:
"""Create a new Global stack
-
+
:param new_stack_id: The ID of the new stack.
:param definition: The definition to base the new stack on.
:param variant_container: The variant selected for the current stack.
:param material_container: The material selected for the current stack.
:param quality_container: The quality selected for the current stack.
-
+
:return: A new Global stack instance with the specified parameters.
"""
diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py
index 52dfffd3a5..7520d436e9 100644
--- a/cura/Settings/ExtruderStack.py
+++ b/cura/Settings/ExtruderStack.py
@@ -37,7 +37,7 @@ class ExtruderStack(CuraContainerStack):
@override(ContainerStack)
def setNextStack(self, stack: CuraContainerStack, connect_signals: bool = True) -> None:
"""Overridden from ContainerStack
-
+
This will set the next stack and ensure that we register this stack as an extruder.
"""
@@ -71,7 +71,7 @@ class ExtruderStack(CuraContainerStack):
def getCompatibleMaterialDiameter(self) -> float:
"""Return the filament diameter that the machine requires.
-
+
If the machine has no requirement for the diameter, -1 is returned.
:return: The filament diameter for the printer
"""
@@ -99,12 +99,12 @@ class ExtruderStack(CuraContainerStack):
def getApproximateMaterialDiameter(self) -> float:
"""Return the approximate filament diameter that the machine requires.
-
+
The approximate material diameter is the material diameter rounded to
the nearest millimetre.
-
+
If the machine has no requirement for the diameter, -1 is returned.
-
+
:return: The approximate filament diameter for the printer
"""
@@ -116,12 +116,12 @@ class ExtruderStack(CuraContainerStack):
@override(ContainerStack)
def getProperty(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> Any:
"""Overridden from ContainerStack
-
+
It will perform a few extra checks when trying to get properties.
-
+
The two extra checks it currently does is to ensure a next stack is set and to bypass
the extruder when the property is not settable per extruder.
-
+
:throws Exceptions.NoGlobalStackError Raised when trying to get a property from an extruder without
having a next stack set.
"""
diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py
index e020221187..929c567921 100755
--- a/cura/Settings/GlobalStack.py
+++ b/cura/Settings/GlobalStack.py
@@ -62,7 +62,7 @@ class GlobalStack(CuraContainerStack):
@deprecated("Please use extruderList instead.", "4.4")
def extruders(self) -> Dict[str, "ExtruderStack"]:
"""Get the list of extruders of this stack.
-
+
:return: The extruders registered with this stack.
"""
@@ -91,11 +91,11 @@ class GlobalStack(CuraContainerStack):
@pyqtProperty("QVariantList", notify=configuredConnectionTypesChanged)
def configuredConnectionTypes(self) -> List[int]:
"""The configured connection types can be used to find out if the global
-
+
stack is configured to be connected with a printer, without having to
know all the details as to how this is exactly done (and without
actually setting the stack to be active).
-
+
This data can then in turn also be used when the global stack is active;
If we can't get a network connection, but it is configured to have one,
we can display a different icon to indicate the difference.
@@ -171,9 +171,9 @@ class GlobalStack(CuraContainerStack):
def addExtruder(self, extruder: ContainerStack) -> None:
"""Add an extruder to the list of extruders of this stack.
-
+
:param extruder: The extruder to add.
-
+
:raise Exceptions.TooManyExtrudersError: Raised when trying to add an extruder while we
already have the maximum number of extruders.
"""
@@ -194,15 +194,15 @@ class GlobalStack(CuraContainerStack):
@override(ContainerStack)
def getProperty(self, key: str, property_name: str, context: Optional[PropertyEvaluationContext] = None) -> Any:
"""Overridden from ContainerStack
-
+
This will return the value of the specified property for the specified setting,
unless the property is "value" and that setting has a "resolve" function set.
When a resolve is set, it will instead try and execute the resolve first and
then fall back to the normal "value" property.
-
+
:param key: The setting key to get the property of.
:param property_name: The property to get the value of.
-
+
:return: The value of the property for the specified setting, or None if not found.
"""
@@ -248,7 +248,7 @@ class GlobalStack(CuraContainerStack):
@override(ContainerStack)
def setNextStack(self, stack: CuraContainerStack, connect_signals: bool = True) -> None:
"""Overridden from ContainerStack
-
+
This will simply raise an exception since the Global stack cannot have a next stack.
"""
@@ -281,7 +281,7 @@ class GlobalStack(CuraContainerStack):
def isValid(self) -> bool:
"""Perform some sanity checks on the global stack
-
+
Sanity check for extruders; they must have positions 0 and up to machine_extruder_count - 1
"""
container_registry = ContainerRegistry.getInstance()
diff --git a/cura/Settings/IntentManager.py b/cura/Settings/IntentManager.py
index 9f636c9cc1..a556a86dd8 100644
--- a/cura/Settings/IntentManager.py
+++ b/cura/Settings/IntentManager.py
@@ -32,9 +32,9 @@ class IntentManager(QObject):
def intentMetadatas(self, definition_id: str, nozzle_name: str, material_base_file: str) -> List[Dict[str, Any]]:
"""Gets the metadata dictionaries of all intent profiles for a given
-
+
configuration.
-
+
:param definition_id: ID of the printer.
:param nozzle_name: Name of the nozzle.
:param material_base_file: The base_file of the material.
@@ -58,9 +58,9 @@ class IntentManager(QObject):
def intentCategories(self, definition_id: str, nozzle_id: str, material_id: str) -> List[str]:
"""Collects and returns all intent categories available for the given
-
+
parameters. Note that the 'default' category is always available.
-
+
:param definition_id: ID of the printer.
:param nozzle_name: Name of the nozzle.
:param material_id: ID of the material.
@@ -74,10 +74,10 @@ class IntentManager(QObject):
def getCurrentAvailableIntents(self) -> List[Tuple[str, str]]:
"""List of intents to be displayed in the interface.
-
+
For the interface this will have to be broken up into the different
intent categories. That is up to the model there.
-
+
:return: A list of tuples of intent_category and quality_type. The actual
instance may vary per extruder.
"""
@@ -109,7 +109,7 @@ class IntentManager(QObject):
def currentAvailableIntentCategories(self) -> List[str]:
"""List of intent categories available in either of the extruders.
-
+
This is purposefully inconsistent with the way that the quality types
are listed. The quality types will show all quality types available in
the printer using any configuration. This will only list the intent
@@ -134,7 +134,7 @@ class IntentManager(QObject):
def getDefaultIntent(self) -> "InstanceContainer":
"""The intent that gets selected by default when no intent is available for
-
+
the configuration, an extruder can't match the intent that the user
selects, or just when creating a new printer.
"""
diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py
index 045307c673..e5286e7032 100755
--- a/cura/Settings/MachineManager.py
+++ b/cura/Settings/MachineManager.py
@@ -342,7 +342,7 @@ class MachineManager(QObject):
@staticmethod
def getMachine(definition_id: str, metadata_filter: Optional[Dict[str, str]] = None) -> Optional["GlobalStack"]:
"""Given a definition id, return the machine with this id.
-
+
Optional: add a list of keys and values to filter the list of machines with the given definition id
:param definition_id: :type{str} definition id that needs to look for
:param metadata_filter: :type{dict} list of metadata keys and values used for filtering
@@ -430,7 +430,7 @@ class MachineManager(QObject):
@pyqtSlot(str)
def clearUserSettingAllCurrentStacks(self, key: str) -> None:
"""Delete a user setting from the global stack and all extruder stacks.
-
+
:param key: :type{str} the name of the key to delete
"""
Logger.log("i", "Clearing the setting [%s] from all stacks", key)
@@ -464,7 +464,7 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = stacksValidationChanged)
def stacksHaveErrors(self) -> bool:
"""Check if none of the stacks contain error states
-
+
Note that the _stacks_have_errors is cached due to performance issues
Calling _checkStack(s)ForErrors on every change is simply too expensive
"""
@@ -503,7 +503,7 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasCloudRegistration(self) -> bool:
return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes
-
+
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsUsingCloudConnection(self) -> bool:
return self.activeMachineHasCloudConnection and not self.activeMachineHasNetworkConnection
@@ -544,9 +544,9 @@ class MachineManager(QObject):
@pyqtProperty(float, notify = activeQualityGroupChanged)
def activeQualityLayerHeight(self) -> float:
"""Gets the layer height of the currently active quality profile.
-
+
This is indicated together with the name of the active quality profile.
-
+
:return: The layer height of the currently active quality profile. If
there is no quality profile, this returns the default layer height.
"""
@@ -623,7 +623,7 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = activeQualityChanged)
def isCurrentSetupSupported(self) -> bool:
"""Returns whether there is anything unsupported in the current set-up.
-
+
The current set-up signifies the global stack and all extruder stacks,
so this indicates whether there is any container in any of the container
stacks that is not marked as supported.
@@ -670,7 +670,7 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = globalContainerChanged)
def activeQualityDefinitionId(self) -> str:
"""Get the Definition ID to use to select quality profiles for the currently active machine
-
+
:returns: DefinitionID (string) if found, empty string otherwise
"""
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
@@ -681,7 +681,7 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = globalContainerChanged)
def activeDefinitionVariantsName(self) -> str:
"""Gets how the active definition calls variants
-
+
Caveat: per-definition-variant-title is currently not translated (though the fallback is)
"""
fallback_title = catalog.i18nc("@label", "Nozzle")
@@ -754,7 +754,7 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = activeMaterialChanged)
def variantBuildplateUsable(self) -> bool:
"""The selected buildplate is usable if it is usable for all materials OR it is compatible for one but not compatible
-
+
for the other material but the buildplate is still usable
"""
if not self._global_container_stack:
@@ -780,7 +780,7 @@ class MachineManager(QObject):
@pyqtSlot(str, result = str)
def getDefinitionByMachineId(self, machine_id: str) -> Optional[str]:
"""Get the Definition ID of a machine (specified by ID)
-
+
:param machine_id: string machine id to get the definition ID of
:returns: DefinitionID if found, None otherwise
"""
@@ -834,7 +834,7 @@ class MachineManager(QObject):
def setActiveMachineExtruderCount(self, extruder_count: int) -> None:
"""Set the amount of extruders on the active machine (global stack)
-
+
:param extruder_count: int the number of extruders to set
"""
if self._global_container_stack is None:
@@ -979,7 +979,7 @@ class MachineManager(QObject):
def _getContainerChangedSignals(self) -> List[Signal]:
"""Get the signals that signal that the containers changed for all stacks.
-
+
This includes the global stack and all extruder stacks. So if any
container changed anywhere.
"""
@@ -999,7 +999,7 @@ class MachineManager(QObject):
@pyqtSlot(str)
def resetSettingForAllExtruders(self, setting_name: str) -> None:
"""Reset all setting properties of a setting for all extruders.
-
+
:param setting_name: The ID of the setting to reset.
"""
if self._global_container_stack is None:
@@ -1247,7 +1247,7 @@ class MachineManager(QObject):
@pyqtSlot()
def updateMaterialWithVariant(self, position: Optional[str] = None) -> None:
"""Update the material profile in the current stacks when the variant is
-
+
changed.
:param position: The extruder stack to update. If provided with None, all
extruder stacks will be updated.
@@ -1289,7 +1289,7 @@ class MachineManager(QObject):
@pyqtSlot(str)
def switchPrinterType(self, machine_name: str) -> None:
"""Given a printer definition name, select the right machine instance. In case it doesn't exist, create a new
-
+
instance with the same network key.
"""
# Don't switch if the user tries to change to the same type of printer
@@ -1311,7 +1311,7 @@ class MachineManager(QObject):
if not new_machine:
Logger.log("e", "Failed to create new machine when switching configuration.")
return
-
+
for metadata_key in self._global_container_stack.getMetaData():
if metadata_key in new_machine.getMetaData():
continue # Don't copy the already preset stuff.
@@ -1444,7 +1444,7 @@ class MachineManager(QObject):
@pyqtSlot(str, "QVariant")
def setMaterial(self, position: str, container_node, global_stack: Optional["GlobalStack"] = None) -> None:
"""Global_stack: if you want to provide your own global_stack instead of the current active one
-
+
if you update an active machine, special measures have to be taken.
"""
if global_stack is not None and global_stack != self._global_container_stack:
@@ -1495,7 +1495,7 @@ class MachineManager(QObject):
@pyqtSlot(QObject)
def setQualityGroup(self, quality_group: "QualityGroup", no_dialog: bool = False, global_stack: Optional["GlobalStack"] = None) -> None:
"""Optionally provide global_stack if you want to use your own
-
+
The active global_stack is treated differently.
"""
if global_stack is not None and global_stack != self._global_container_stack:
@@ -1562,7 +1562,7 @@ class MachineManager(QObject):
@pyqtSlot(str)
def setIntentByCategory(self, intent_category: str) -> None:
"""Change the intent category of the current printer.
-
+
All extruders can change their profiles. If an intent profile is
available with the desired intent category, that one will get chosen.
Otherwise the intent profile will be left to the empty profile, which
@@ -1603,7 +1603,7 @@ class MachineManager(QObject):
def activeQualityGroup(self) -> Optional["QualityGroup"]:
"""Get the currently activated quality group.
-
+
If no printer is added yet or the printer doesn't have quality profiles,
this returns ``None``.
:return: The currently active quality group.
@@ -1617,7 +1617,7 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = activeQualityGroupChanged)
def activeQualityGroupName(self) -> str:
"""Get the name of the active quality group.
-
+
:return: The name of the active quality group.
"""
quality_group = self.activeQualityGroup()
diff --git a/cura/Settings/MachineNameValidator.py b/cura/Settings/MachineNameValidator.py
index 2bb614f093..8ab8907355 100644
--- a/cura/Settings/MachineNameValidator.py
+++ b/cura/Settings/MachineNameValidator.py
@@ -13,7 +13,7 @@ from UM.Settings.InstanceContainer import InstanceContainer
class MachineNameValidator(QObject):
"""Are machine names valid?
-
+
Performs checks based on the length of the name.
"""
@@ -37,7 +37,7 @@ class MachineNameValidator(QObject):
def validate(self, name):
"""Check if a specified machine name is allowed.
-
+
:param name: The machine name to check.
:return: ``QValidator.Invalid`` if it's disallowed, or ``QValidator.Acceptable`` if it's allowed.
"""
diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py
index d48bff042f..1b5fb84f4a 100644
--- a/cura/Settings/SettingOverrideDecorator.py
+++ b/cura/Settings/SettingOverrideDecorator.py
@@ -18,7 +18,7 @@ from cura.Settings.ExtruderManager import ExtruderManager
@signalemitter
class SettingOverrideDecorator(SceneNodeDecorator):
"""A decorator that adds a container stack to a Node. This stack should be queried for all settings regarding
-
+
the linked node. The Stack in question will refer to the global stack (so that settings that are not defined by
this stack still resolve.
"""
@@ -27,7 +27,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
_non_printing_mesh_settings = {"anti_overhang_mesh", "infill_mesh", "cutting_mesh"}
"""Non-printing meshes
-
+
If these settings are True for any mesh, the mesh does not need a convex hull,
and is sent to the slicer regardless of whether it fits inside the build volume.
Note that Support Mesh is not in here because it actually generates
@@ -83,7 +83,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def getActiveExtruder(self):
"""Gets the currently active extruder to print this object with.
-
+
:return: An extruder's container stack.
"""
@@ -91,7 +91,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def getActiveExtruderChangedSignal(self):
"""Gets the signal that emits if the active extruder changed.
-
+
This can then be accessed via a decorator.
"""
@@ -99,7 +99,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def getActiveExtruderPosition(self):
"""Gets the currently active extruders position
-
+
:return: An extruder's position, or None if no position info is available.
"""
@@ -137,7 +137,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def _updateNextStack(self):
"""Makes sure that the stack upon which the container stack is placed is
-
+
kept up to date.
"""
if self._extruder_stack:
@@ -160,7 +160,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def setActiveExtruder(self, extruder_stack_id):
"""Changes the extruder with which to print this node.
-
+
:param extruder_stack_id: The new extruder stack to print with.
"""
diff --git a/cura/UI/MachineActionManager.py b/cura/UI/MachineActionManager.py
index 25234fd43f..5e31de32c2 100644
--- a/cura/UI/MachineActionManager.py
+++ b/cura/UI/MachineActionManager.py
@@ -75,7 +75,7 @@ class MachineActionManager(QObject):
def addRequiredAction(self, definition_id: str, action_key: str) -> None:
"""Add a required action to a machine
-
+
Raises an exception when the action is not recognised.
"""
if action_key in self._machine_actions:
@@ -112,7 +112,7 @@ class MachineActionManager(QObject):
def addMachineAction(self, action: "MachineAction") -> None:
"""Add a (unique) MachineAction
-
+
if the Key of the action is not unique, an exception is raised.
"""
if action.getKey() not in self._machine_actions:
@@ -123,7 +123,7 @@ class MachineActionManager(QObject):
@pyqtSlot(str, result = "QVariantList")
def getSupportedActions(self, definition_id: str) -> List["MachineAction"]:
"""Get all actions supported by given machine
-
+
:param definition_id: The ID of the definition you want the supported actions of
:returns: set of supported actions.
"""
@@ -134,7 +134,7 @@ class MachineActionManager(QObject):
def getRequiredActions(self, definition_id: str) -> List["MachineAction"]:
"""Get all actions required by given machine
-
+
:param definition_id: The ID of the definition you want the required actions of
:returns: set of required actions.
"""
@@ -146,7 +146,7 @@ class MachineActionManager(QObject):
@pyqtSlot(str, result = "QVariantList")
def getFirstStartActions(self, definition_id: str) -> List["MachineAction"]:
"""Get all actions that need to be performed upon first start of a given machine.
-
+
Note that contrary to required / supported actions a list is returned (as it could be required to run the same
action multiple times).
:param definition_id: The ID of the definition that you want to get the "on added" actions for.
@@ -159,7 +159,7 @@ class MachineActionManager(QObject):
def removeMachineAction(self, action: "MachineAction") -> None:
"""Remove Machine action from manager
-
+
:param action: to remove
"""
try:
@@ -169,7 +169,7 @@ class MachineActionManager(QObject):
def getMachineAction(self, key: str) -> Optional["MachineAction"]:
"""Get MachineAction by key
-
+
:param key: String of key to select
:return: Machine action if found, None otherwise
"""
diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py
index cbe0900ec0..ae4aab0407 100644
--- a/cura/UI/PrintInformation.py
+++ b/cura/UI/PrintInformation.py
@@ -23,7 +23,7 @@ catalog = i18nCatalog("cura")
class PrintInformation(QObject):
"""A class for processing and the print times per build plate as well as managing the job name
-
+
This class also mangles the current machine name and the filename of the first loaded mesh into a job name.
This job name is requested by the JobSpecs qml file.
"""
diff --git a/cura/Utils/Decorators.py b/cura/Utils/Decorators.py
index 7be718c51c..b478f172bc 100644
--- a/cura/Utils/Decorators.py
+++ b/cura/Utils/Decorators.py
@@ -13,9 +13,9 @@ SEMANTIC_VERSION_REGEX = re.compile(r"^[0-9]+\.[0-9]+(\.[0-9]+)?$")
def api(since_version: str) -> Callable:
"""Decorator for functions that belong to a set of APIs. For now, this should only be used for officially supported
-
+
APIs, meaning that those APIs should be versioned and maintained.
-
+
:param since_version: The earliest version since when this API becomes supported. This means that since this version,
this API function is supposed to behave the same. This parameter is not used. It's just a
documentation.
diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py
index 32e12cb91a..546c6fc27b 100755
--- a/plugins/3MFReader/ThreeMFReader.py
+++ b/plugins/3MFReader/ThreeMFReader.py
@@ -59,11 +59,11 @@ class ThreeMFReader(MeshReader):
temp_mat = Matrix()
"""Transformation is saved as:
M00 M01 M02 0.0
-
+
M10 M11 M12 0.0
-
+
M20 M21 M22 0.0
-
+
M30 M31 M32 1.0
We switch the row & cols as that is how everyone else uses matrices!
"""
@@ -87,7 +87,7 @@ class ThreeMFReader(MeshReader):
def _convertSavitarNodeToUMNode(self, savitar_node: Savitar.SceneNode, file_name: str = "") -> Optional[SceneNode]:
"""Convenience function that converts a SceneNode object (as obtained from libSavitar) to a scene node.
-
+
:returns: Scene node.
"""
try:
@@ -252,7 +252,7 @@ class ThreeMFReader(MeshReader):
def _getScaleFromUnit(self, unit: Optional[str]) -> Vector:
"""Create a scale vector based on a unit string.
-
+
.. The core spec defines the following:
* micron
* millimeter (default)
diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py
index 88187cd732..a744d29449 100755
--- a/plugins/3MFReader/ThreeMFWorkspaceReader.py
+++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py
@@ -133,7 +133,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
def getNewId(self, old_id: str):
"""Get a unique name based on the old_id. This is different from directly calling the registry in that it caches results.
-
+
This has nothing to do with speed, but with getting consistent new naming for instances & objects.
"""
if old_id not in self._id_mapping:
@@ -142,7 +142,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
def _determineGlobalAndExtruderStackFiles(self, project_file_name: str, file_list: List[str]) -> Tuple[str, List[str]]:
"""Separates the given file list into a list of GlobalStack files and a list of ExtruderStack files.
-
+
In old versions, extruder stack files have the same suffix as container stack files ".stack.cfg".
"""
@@ -187,7 +187,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
def preRead(self, file_name, show_dialog=True, *args, **kwargs):
"""Read some info so we can make decisions
-
+
:param file_name:
:param show_dialog: In case we use preRead() to check if a file is a valid project file,
we don't want to show a dialog.
@@ -588,12 +588,12 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
@call_on_qt_thread
def read(self, file_name):
"""Read the project file
-
+
Add all the definitions / materials / quality changes that do not exist yet. Then it loads
all the stacks into the container registry. In some cases it will reuse the container for the global stack.
It handles old style project files containing .stack.cfg as well as new style project files
containing global.cfg / extruder.cfg
-
+
:param file_name:
"""
application = CuraApplication.getInstance()
@@ -879,7 +879,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
def _createNewQualityChanges(self, quality_type: str, intent_category: Optional[str], name: str, global_stack: GlobalStack, extruder_stack: Optional[ExtruderStack]) -> InstanceContainer:
"""Helper class to create a new quality changes profile.
-
+
This will then later be filled with the appropriate data.
:param quality_type: The quality type of the new profile.
diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py
index d68338c35f..5e2b68fce0 100644
--- a/plugins/3MFReader/__init__.py
+++ b/plugins/3MFReader/__init__.py
@@ -33,7 +33,7 @@ def getMetaData() -> Dict:
"description": catalog.i18nc("@item:inlistbox", "3MF File")
}
]
-
+
return metaData
diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
index a8d42ab2ee..a7ee47dcf1 100644
--- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
+++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
@@ -110,7 +110,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
@staticmethod
def _writeContainerToArchive(container, archive):
"""Helper function that writes ContainerStacks, InstanceContainers and DefinitionContainers to the archive.
-
+
:param container: That follows the :type{ContainerInterface} to archive.
:param archive: The archive to write to.
"""
diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py
index 343b94a08b..6c02935080 100644
--- a/plugins/3MFWriter/ThreeMFWriter.py
+++ b/plugins/3MFWriter/ThreeMFWriter.py
@@ -62,7 +62,7 @@ class ThreeMFWriter(MeshWriter):
def setStoreArchive(self, store_archive):
"""Should we store the archive
-
+
Note that if this is true, the archive will not be closed.
The object that set this parameter is then responsible for closing it correctly!
"""
@@ -70,7 +70,7 @@ class ThreeMFWriter(MeshWriter):
def _convertUMNodeToSavitarNode(self, um_node, transformation = Matrix()):
"""Convenience function that converts an Uranium SceneNode object to a SavitarSceneNode
-
+
:returns: Uranium Scene node.
"""
if not isinstance(um_node, SceneNode):
diff --git a/plugins/AMFReader/AMFReader.py b/plugins/AMFReader/AMFReader.py
index 5196119d6c..ef785f2f53 100644
--- a/plugins/AMFReader/AMFReader.py
+++ b/plugins/AMFReader/AMFReader.py
@@ -149,7 +149,7 @@ class AMFReader(MeshReader):
def _toMeshData(self, tri_node: trimesh.base.Trimesh, file_name: str = "") -> MeshData:
"""Converts a Trimesh to Uranium's MeshData.
-
+
:param tri_node: A Trimesh containing the contents of a file that was just read.
:param file_name: The full original filename used to watch for changes
:return: Mesh data from the Trimesh in a way that Uranium can understand it.
diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py
index 1c40052521..519d302618 100755
--- a/plugins/CuraEngineBackend/CuraEngineBackend.py
+++ b/plugins/CuraEngineBackend/CuraEngineBackend.py
@@ -207,7 +207,7 @@ class CuraEngineBackend(QObject, Backend):
printDurationMessage = Signal()
"""Emitted when we get a message containing print duration and material amount.
-
+
This also implies the slicing has finished.
:param time: The amount of time the print will take.
:param material_amount: The amount of material the print will use.
diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
index 9cd48cdc94..e0a20177b5 100644
--- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
+++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
@@ -30,7 +30,7 @@ catalog = i18nCatalog("cura")
def colorCodeToRGBA(color_code):
"""Return a 4-tuple with floats 0-1 representing the html color code
-
+
:param color_code: html color code, i.e. "#FF0000" -> red
"""
@@ -55,7 +55,7 @@ class ProcessSlicedLayersJob(Job):
def abort(self):
"""Aborts the processing of layers.
-
+
This abort is made on a best-effort basis, meaning that the actual
job thread will check once in a while to see whether an abort is
requested and then stop processing by itself. There is no guarantee
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py
index fa65033691..8822e9bb17 100644
--- a/plugins/CuraProfileReader/CuraProfileReader.py
+++ b/plugins/CuraProfileReader/CuraProfileReader.py
@@ -16,21 +16,21 @@ import zipfile
class CuraProfileReader(ProfileReader):
"""A plugin that reads profile data from Cura profile files.
-
+
It reads a profile from a .curaprofile file, and returns it as a profile
instance.
"""
def __init__(self) -> None:
"""Initialises the cura profile reader.
-
+
This does nothing since the only other function is basically stateless.
"""
super().__init__()
def read(self, file_name: str) -> List[Optional[InstanceContainer]]:
"""Reads a cura profile from a file and returns it.
-
+
:param file_name: The file to read the cura profile from.
:return: The cura profiles that were in the file, if any. If the file
could not be read or didn't contain a valid profile, ``None`` is
@@ -59,7 +59,7 @@ class CuraProfileReader(ProfileReader):
def _upgradeProfile(self, serialized: str, profile_id: str) -> List[Tuple[str, str]]:
"""Convert a profile from an old Cura to this Cura if needed.
-
+
:param serialized: The profile data to convert in the serialized on-disk format.
:param profile_id: The name of the profile.
:return: List of serialized profile strings and matching profile names.
@@ -85,7 +85,7 @@ class CuraProfileReader(ProfileReader):
def _loadProfile(self, serialized: str, profile_id: str) -> Optional[InstanceContainer]:
"""Load a profile from a serialized string.
-
+
:param serialized: The profile data to read.
:param profile_id: The name of the profile.
:return: The profile that was stored in the string.
@@ -114,7 +114,7 @@ class CuraProfileReader(ProfileReader):
def _upgradeProfileVersion(self, serialized: str, profile_id: str, main_version: int, setting_version: int) -> List[Tuple[str, str]]:
"""Upgrade a serialized profile to the current profile format.
-
+
:param serialized: The profile data to convert.
:param profile_id: The name of the profile.
:param source_version: The profile version of 'serialized'.
diff --git a/plugins/CuraProfileWriter/CuraProfileWriter.py b/plugins/CuraProfileWriter/CuraProfileWriter.py
index 6643bd8d1f..56f4d07a74 100644
--- a/plugins/CuraProfileWriter/CuraProfileWriter.py
+++ b/plugins/CuraProfileWriter/CuraProfileWriter.py
@@ -11,7 +11,7 @@ class CuraProfileWriter(ProfileWriter):
def write(self, path, profiles):
"""Writes a profile to the specified file path.
-
+
:param path: :type{string} The file to output to.
:param profiles: :type{Profile} :type{List} The profile(s) to write to that file.
:return: True if the writing was successful, or
diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py
index 92678cb546..8d0670c844 100644
--- a/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py
+++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateChecker.py
@@ -20,7 +20,7 @@ i18n_catalog = i18nCatalog("cura")
class FirmwareUpdateChecker(Extension):
"""This Extension checks for new versions of the firmware based on the latest checked version number.
-
+
The plugin is currently only usable for applications maintained by Ultimaker. But it should be relatively easy
to change it to work for other applications.
"""
@@ -62,10 +62,10 @@ class FirmwareUpdateChecker(Extension):
def checkFirmwareVersion(self, container = None, silent = False):
"""Connect with software.ultimaker.com, load latest.version and check version info.
-
+
If the version info is different from the current version, spawn a message to
allow the user to download it.
-
+
:param silent: type(boolean) Suppresses messages other than "new version found" messages.
This is used when checking for a new firmware version at startup.
"""
diff --git a/plugins/GCodeGzReader/GCodeGzReader.py b/plugins/GCodeGzReader/GCodeGzReader.py
index b4d9e85b3e..85a5b01107 100644
--- a/plugins/GCodeGzReader/GCodeGzReader.py
+++ b/plugins/GCodeGzReader/GCodeGzReader.py
@@ -10,7 +10,7 @@ from UM.PluginRegistry import PluginRegistry
class GCodeGzReader(MeshReader):
"""A file reader that reads gzipped g-code.
-
+
If you're zipping g-code, you might as well use gzip!
"""
diff --git a/plugins/GCodeGzWriter/GCodeGzWriter.py b/plugins/GCodeGzWriter/GCodeGzWriter.py
index e9dcbad76b..2bbaaeb0a3 100644
--- a/plugins/GCodeGzWriter/GCodeGzWriter.py
+++ b/plugins/GCodeGzWriter/GCodeGzWriter.py
@@ -16,7 +16,7 @@ catalog = i18nCatalog("cura")
class GCodeGzWriter(MeshWriter):
"""A file writer that writes gzipped g-code.
-
+
If you're zipping g-code, you might as well use gzip!
"""
@@ -26,11 +26,11 @@ class GCodeGzWriter(MeshWriter):
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode = MeshWriter.OutputMode.BinaryMode) -> bool:
"""Writes the gzipped g-code to a stream.
-
+
Note that even though the function accepts a collection of nodes, the
entire scene is always written to the file since it is not possible to
separate the g-code for just specific nodes.
-
+
:param stream: The stream to write the gzipped g-code to.
:param nodes: This is ignored.
:param mode: Additional information on what type of stream to use. This
diff --git a/plugins/GCodeProfileReader/GCodeProfileReader.py b/plugins/GCodeProfileReader/GCodeProfileReader.py
index 93bba1db4d..047497e611 100644
--- a/plugins/GCodeProfileReader/GCodeProfileReader.py
+++ b/plugins/GCodeProfileReader/GCodeProfileReader.py
@@ -15,14 +15,14 @@ from cura.ReaderWriters.ProfileReader import ProfileReader, NoProfileException
class GCodeProfileReader(ProfileReader):
"""A class that reads profile data from g-code files.
-
+
It reads the profile data from g-code files and stores it in a new profile.
This class currently does not process the rest of the g-code in any way.
"""
version = 3
"""The file format version of the serialized g-code.
-
+
It can only read settings with the same version as the version it was
written with. If the file format is changed in a way that breaks reverse
compatibility, increment this version number!
@@ -48,7 +48,7 @@ class GCodeProfileReader(ProfileReader):
def read(self, file_name):
"""Reads a g-code file, loading the profile from it.
-
+
:param file_name: The name of the file to read the profile from.
:return: The profile that was in the specified file, if any. If the
specified file was no g-code or contained no parsable profile,
@@ -106,7 +106,7 @@ class GCodeProfileReader(ProfileReader):
def unescapeGcodeComment(string: str) -> str:
"""Unescape a string which has been escaped for use in a gcode comment.
-
+
:param string: The string to unescape.
:return: The unescaped string.
"""
@@ -120,7 +120,7 @@ def unescapeGcodeComment(string: str) -> str:
def readQualityProfileFromString(profile_string) -> Optional[InstanceContainer]:
"""Read in a profile from a serialized string.
-
+
:param profile_string: The profile data in serialized form.
:return: The resulting Profile object or None if it could not be read.
"""
diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py
index bcb7efc816..2d0bd7b7c0 100644
--- a/plugins/GCodeReader/FlavorParser.py
+++ b/plugins/GCodeReader/FlavorParser.py
@@ -237,7 +237,7 @@ class FlavorParser:
def _gCode92(self, position: Position, params: PositionOptional, path: List[List[Union[float, int]]]) -> Position:
"""Reset the current position to the values specified.
-
+
For example: G92 X10 will set the X to 10 without any physical motion.
"""
diff --git a/plugins/GCodeReader/RepRapFlavorParser.py b/plugins/GCodeReader/RepRapFlavorParser.py
index 05f86beab0..10b7b78587 100644
--- a/plugins/GCodeReader/RepRapFlavorParser.py
+++ b/plugins/GCodeReader/RepRapFlavorParser.py
@@ -21,7 +21,7 @@ class RepRapFlavorParser(FlavorParser.FlavorParser):
def _gCode90(self, position, params, path):
"""Set the absolute positioning
-
+
RepRapFlavor code G90 sets position of X, Y, Z to absolute
For absolute E, M82 is used
"""
@@ -30,7 +30,7 @@ class RepRapFlavorParser(FlavorParser.FlavorParser):
def _gCode91(self, position, params, path):
"""Set the relative positioning
-
+
RepRapFlavor code G91 sets position of X, Y, Z to relative
For relative E, M83 is used
"""
diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py
index 93ff0f51ff..160857443b 100644
--- a/plugins/GCodeWriter/GCodeWriter.py
+++ b/plugins/GCodeWriter/GCodeWriter.py
@@ -17,12 +17,12 @@ catalog = i18nCatalog("cura")
class GCodeWriter(MeshWriter):
"""Writes g-code to a file.
-
+
While this poses as a mesh writer, what this really does is take the g-code
in the entire scene and write it to an output device. Since the g-code of a
single mesh isn't separable from the rest what with rafts and travel moves
and all, it doesn't make sense to write just a single mesh.
-
+
So this plug-in takes the g-code that is stored in the root of the scene
node tree, adds a bit of extra information about the profiles and writes
that to the output device.
@@ -30,7 +30,7 @@ class GCodeWriter(MeshWriter):
version = 3
"""The file format version of the serialised g-code.
-
+
It can only read settings with the same version as the version it was
written with. If the file format is changed in a way that breaks reverse
compatibility, increment this version number!
@@ -42,9 +42,9 @@ class GCodeWriter(MeshWriter):
re.escape("\r"): "\\r" # Carriage return. Windows users may need this for visualisation in their editors.
}
"""Dictionary that defines how characters are escaped when embedded in
-
+
g-code.
-
+
Note that the keys of this dictionary are regex strings. The values are
not.
"""
@@ -58,11 +58,11 @@ class GCodeWriter(MeshWriter):
def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode):
"""Writes the g-code for the entire scene to a stream.
-
+
Note that even though the function accepts a collection of nodes, the
entire scene is always written to the file since it is not possible to
separate the g-code for just specific nodes.
-
+
:param stream: The stream to write the g-code to.
:param nodes: This is ignored.
:param mode: Additional information on how to format the g-code in the
@@ -117,10 +117,10 @@ class GCodeWriter(MeshWriter):
def _serialiseSettings(self, stack):
"""Serialises a container stack to prepare it for writing at the end of the g-code.
-
+
The settings are serialised, and special characters (including newline)
are escaped.
-
+
:param stack: A container stack to serialise.
:return: A serialised string of the settings.
"""
diff --git a/plugins/LegacyProfileReader/LegacyProfileReader.py b/plugins/LegacyProfileReader/LegacyProfileReader.py
index c67136ce9b..0bc82ad287 100644
--- a/plugins/LegacyProfileReader/LegacyProfileReader.py
+++ b/plugins/LegacyProfileReader/LegacyProfileReader.py
@@ -18,14 +18,14 @@ from cura.ReaderWriters.ProfileReader import ProfileReader # The plug-in type t
class LegacyProfileReader(ProfileReader):
"""A plugin that reads profile data from legacy Cura versions.
-
+
It reads a profile from an .ini file, and performs some translations on it.
Not all translations are correct, mind you, but it is a best effort.
"""
def __init__(self):
"""Initialises the legacy profile reader.
-
+
This does nothing since the only other function is basically stateless.
"""
@@ -33,9 +33,9 @@ class LegacyProfileReader(ProfileReader):
def prepareDefaults(self, json: Dict[str, Dict[str, str]]) -> Dict[str, str]:
"""Prepares the default values of all legacy settings.
-
+
These are loaded from the Dictionary of Doom.
-
+
:param json: The JSON file to load the default setting values from. This
should not be a URL but a pre-loaded JSON handle.
:return: A dictionary of the default values of the legacy Cura version.
@@ -49,13 +49,13 @@ class LegacyProfileReader(ProfileReader):
def prepareLocals(self, config_parser, config_section, defaults):
"""Prepares the local variables that can be used in evaluation of computing
-
+
new setting values from the old ones.
-
+
This fills a dictionary with all settings from the legacy Cura version
and their values, so that they can be used in evaluating the new setting
values as Python code.
-
+
:param config_parser: The ConfigParser that finds the settings in the
legacy profile.
:param config_section: The section in the profile where the settings
@@ -71,7 +71,7 @@ class LegacyProfileReader(ProfileReader):
def read(self, file_name):
"""Reads a legacy Cura profile from a file and returns it.
-
+
:param file_name: The file to read the legacy Cura profile from.
:return: The legacy Cura profile that was in the file, if any. If the
file could not be read or didn't contain a valid profile, None is returned.
diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.py b/plugins/MachineSettingsAction/MachineSettingsAction.py
index c82ef8f351..f3359a1c56 100755
--- a/plugins/MachineSettingsAction/MachineSettingsAction.py
+++ b/plugins/MachineSettingsAction/MachineSettingsAction.py
@@ -25,7 +25,7 @@ catalog = UM.i18n.i18nCatalog("cura")
class MachineSettingsAction(MachineAction):
"""This action allows for certain settings that are "machine only") to be modified.
-
+
It automatically detects machine definitions that it knows how to change and attaches itself to those.
"""
def __init__(self, parent: Optional["QObject"] = None) -> None:
@@ -60,7 +60,7 @@ class MachineSettingsAction(MachineAction):
def _updateHasMaterialsInContainerTree(self) -> None:
"""Triggered when the global container stack changes or when the g-code
-
+
flavour setting is changed.
"""
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
diff --git a/plugins/ModelChecker/ModelChecker.py b/plugins/ModelChecker/ModelChecker.py
index 138d84cc86..b482667976 100644
--- a/plugins/ModelChecker/ModelChecker.py
+++ b/plugins/ModelChecker/ModelChecker.py
@@ -49,7 +49,7 @@ class ModelChecker(QObject, Extension):
def _pluginsInitialized(self):
"""Called when plug-ins are initialized.
-
+
This makes sure that we listen to changes of the material and that the
button is created that indicates warnings with the current set-up.
"""
diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py b/plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py
index c44e4a4df3..445f7ff676 100644
--- a/plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py
+++ b/plugins/PerObjectSettingsTool/PerObjectSettingVisibilityHandler.py
@@ -17,7 +17,7 @@ from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
"""The per object setting visibility handler ensures that only setting
-
+
definitions that have a matching instance Container are returned as visible.
"""
def __init__(self, parent = None, *args, **kwargs):
diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py
index d23096c0a3..77f1c33a5f 100644
--- a/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py
+++ b/plugins/PerObjectSettingsTool/PerObjectSettingsTool.py
@@ -14,7 +14,7 @@ from UM.Event import Event
class PerObjectSettingsTool(Tool):
"""This tool allows the user to add & change settings per node in the scene.
-
+
The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
"""
def __init__(self):
@@ -52,7 +52,7 @@ class PerObjectSettingsTool(Tool):
def getSelectedActiveExtruder(self):
"""Gets the active extruder of the currently selected object.
-
+
:return: The active extruder of the currently selected object.
"""
@@ -61,7 +61,7 @@ class PerObjectSettingsTool(Tool):
def setSelectedActiveExtruder(self, extruder_stack_id):
"""Changes the active extruder of the currently selected object.
-
+
:param extruder_stack_id: The ID of the extruder to print the currently
selected object with.
"""
diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.py b/plugins/PostProcessingPlugin/PostProcessingPlugin.py
index c1135640dd..90f3d26cd6 100644
--- a/plugins/PostProcessingPlugin/PostProcessingPlugin.py
+++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.py
@@ -132,7 +132,7 @@ class PostProcessingPlugin(QObject, Extension):
def loadAllScripts(self) -> None:
"""Load all scripts from all paths where scripts can be found.
-
+
This should probably only be done on init.
"""
@@ -157,7 +157,7 @@ class PostProcessingPlugin(QObject, Extension):
def loadScripts(self, path: str) -> None:
"""Load all scripts from provided path.
-
+
This should probably only be done on init.
:param path: Path to check for scripts.
"""
@@ -360,7 +360,7 @@ class PostProcessingPlugin(QObject, Extension):
def _propertyChanged(self) -> None:
"""Property changed: trigger re-slice
-
+
To do this we use the global container stack propertyChanged.
Re-slicing is necessary for setting changes in this plugin, because the changes
are applied only once per "fresh" gcode
diff --git a/plugins/PostProcessingPlugin/Script.py b/plugins/PostProcessingPlugin/Script.py
index d15b209478..3228870dca 100644
--- a/plugins/PostProcessingPlugin/Script.py
+++ b/plugins/PostProcessingPlugin/Script.py
@@ -81,7 +81,7 @@ class Script:
def getSettingData(self) -> Dict[str, Any]:
"""Needs to return a dict that can be used to construct a settingcategory file.
-
+
See the example script for an example.
It follows the same style / guides as the Uranium settings.
Scripts can either override getSettingData directly, or use getSettingDataString
@@ -116,7 +116,7 @@ class Script:
def getValue(self, line: str, key: str, default = None) -> Any:
"""Convenience function that finds the value in a line of g-code.
-
+
When requesting key = x from line "G1 X100" the value 100 is returned.
"""
if not key in line or (';' in line and line.find(key) > line.find(';')):
@@ -135,7 +135,7 @@ class Script:
def putValue(self, line: str = "", **kwargs) -> str:
"""Convenience function to produce a line of g-code.
-
+
You can put in an original g-code line and it'll re-use all the values
in that line.
All other keyword parameters are put in the result in g-code's format.
@@ -190,7 +190,7 @@ class Script:
def execute(self, data: List[str]) -> List[str]:
"""This is called when the script is executed.
-
+
It gets a list of g-code strings and needs to return a (modified) list.
"""
raise NotImplementedError()
diff --git a/plugins/PostProcessingPlugin/scripts/ColorMix.py b/plugins/PostProcessingPlugin/scripts/ColorMix.py
index 45b2a0ad70..dacb40e905 100644
--- a/plugins/PostProcessingPlugin/scripts/ColorMix.py
+++ b/plugins/PostProcessingPlugin/scripts/ColorMix.py
@@ -20,7 +20,7 @@
# Uses -
# M163 - Set Mix Factor
# M164 - Save Mix - saves to T2 as a unique mix
-
+
import re #To perform the search and replace.
from ..Script import Script
@@ -127,7 +127,7 @@ class ColorMix(Script):
firstMix = self.getSettingValueByKey("mix_start")
secondMix = self.getSettingValueByKey("mix_finish")
modelOfInterest = self.getSettingValueByKey("object_number")
-
+
#get layer height
layerHeight = 0
for active_layer in data:
@@ -138,11 +138,11 @@ class ColorMix(Script):
break
if layerHeight != 0:
break
-
+
#default layerHeight if not found
if layerHeight == 0:
layerHeight = .2
-
+
#get layers to use
startLayer = 0
endLayer = 0
diff --git a/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py b/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py
index cbd131f17e..d589e63fb3 100644
--- a/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py
+++ b/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py
@@ -56,7 +56,7 @@ class DisplayFilenameAndLayerOnLCD(Script):
}
}
}"""
-
+
def execute(self, data):
max_layer = 0
if self.getSettingValueByKey("name") != "":
@@ -96,5 +96,5 @@ class DisplayFilenameAndLayerOnLCD(Script):
i += 1
final_lines = "\n".join(lines)
data[layer_index] = final_lines
-
+
return data
diff --git a/plugins/PostProcessingPlugin/scripts/FilamentChange.py b/plugins/PostProcessingPlugin/scripts/FilamentChange.py
index 351b985d49..74b9687f8c 100644
--- a/plugins/PostProcessingPlugin/scripts/FilamentChange.py
+++ b/plugins/PostProcessingPlugin/scripts/FilamentChange.py
@@ -65,7 +65,7 @@ class FilamentChange(Script):
def execute(self, data: List[str]):
"""Inserts the filament change g-code at specific layer numbers.
-
+
:param data: A list of layers of g-code.
:return: A similar list, with filament change commands inserted.
"""
diff --git a/plugins/PostProcessingPlugin/scripts/SearchAndReplace.py b/plugins/PostProcessingPlugin/scripts/SearchAndReplace.py
index b601a037da..a0c3648304 100644
--- a/plugins/PostProcessingPlugin/scripts/SearchAndReplace.py
+++ b/plugins/PostProcessingPlugin/scripts/SearchAndReplace.py
@@ -8,7 +8,7 @@ from ..Script import Script
class SearchAndReplace(Script):
"""Performs a search-and-replace on all g-code.
-
+
Due to technical limitations, the search can't cross the border between
layers.
"""
diff --git a/plugins/PostProcessingPlugin/scripts/UsePreviousProbeMeasurements.py b/plugins/PostProcessingPlugin/scripts/UsePreviousProbeMeasurements.py
index 271cb57100..62989f6c7e 100644
--- a/plugins/PostProcessingPlugin/scripts/UsePreviousProbeMeasurements.py
+++ b/plugins/PostProcessingPlugin/scripts/UsePreviousProbeMeasurements.py
@@ -30,7 +30,7 @@ class UsePreviousProbeMeasurements(Script):
}
}
}"""
-
+
def execute(self, data):
text = "M501 ;load bed level data\nM420 S1 ;enable bed leveling"
if self.getSettingValueByKey("use_previous_measurements"):
diff --git a/plugins/PreviewStage/PreviewStage.py b/plugins/PreviewStage/PreviewStage.py
index deec8b4197..88f432ef9b 100644
--- a/plugins/PreviewStage/PreviewStage.py
+++ b/plugins/PreviewStage/PreviewStage.py
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
class PreviewStage(CuraStage):
"""Displays a preview of what you're about to print.
-
+
The Python component of this stage just loads PreviewMain.qml for display
when the stage is selected, and makes sure that it reverts to the previous
view when the previous stage is activated.
@@ -28,14 +28,14 @@ class PreviewStage(CuraStage):
def onStageSelected(self) -> None:
"""When selecting the stage, remember which was the previous view so that
-
+
we can revert to that view when we go out of the stage later.
"""
self._previously_active_view = self._application.getController().getActiveView()
def onStageDeselected(self) -> None:
"""Called when going to a different stage (away from the Preview Stage).
-
+
When going to a different stage, the view should be reverted to what it
was before. Normally, that just reverts it to solid view.
"""
@@ -46,7 +46,7 @@ class PreviewStage(CuraStage):
def _engineCreated(self) -> None:
"""Delayed load of the QML files.
-
+
We need to make sure that the QML engine is running before we can load
these.
"""
diff --git a/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py
index 3661bfa63c..7b3363308d 100644
--- a/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py
+++ b/plugins/RemovableDriveOutputDevice/LinuxRemovableDrivePlugin.py
@@ -13,7 +13,7 @@ import subprocess
class LinuxRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
"""Support for removable devices on Linux.
-
+
TODO: This code uses the most basic interfaces for handling this.
We should instead use UDisks2 to handle mount/unmount and hotplugging events.
"""
diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
index a4fe7309f7..46f38500ee 100644
--- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
+++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
@@ -30,7 +30,7 @@ class RemovableDriveOutputDevice(OutputDevice):
def requestWrite(self, nodes, file_name = None, filter_by_machine = False, file_handler = None, **kwargs):
"""Request the specified nodes to be written to the removable drive.
-
+
:param nodes: A collection of scene nodes that should be written to the
removable drive.
:param file_name: :type{string} A suggestion for the file name to write to.
@@ -38,7 +38,7 @@ class RemovableDriveOutputDevice(OutputDevice):
meshes.
:param limit_mimetypes: Should we limit the available MIME types to the
MIME types available to the currently active machine?
-
+
"""
filter_by_machine = True # This plugin is intended to be used by machine (regardless of what it was told to do)
@@ -110,10 +110,10 @@ class RemovableDriveOutputDevice(OutputDevice):
def _automaticFileName(self, nodes):
"""Generate a file name automatically for the specified nodes to be saved in.
-
+
The name generated will be the name of one of the nodes. Which node that
is can not be guaranteed.
-
+
:param nodes: A collection of nodes for which to generate a file name.
"""
for root in nodes:
diff --git a/plugins/SentryLogger/SentryLogger.py b/plugins/SentryLogger/SentryLogger.py
index 55bcc7e806..29230abb1f 100644
--- a/plugins/SentryLogger/SentryLogger.py
+++ b/plugins/SentryLogger/SentryLogger.py
@@ -20,7 +20,7 @@ class SentryLogger(LogOutput):
# processed and ready for sending.
# Note that this only prepares them for sending. It only sends them when the user actually agrees to sending the
# information.
-
+
_levels = {
"w": "warning",
"i": "info",
@@ -32,10 +32,10 @@ class SentryLogger(LogOutput):
def __init__(self) -> None:
super().__init__()
self._show_once = set() # type: Set[str]
-
+
def log(self, log_type: str, message: str) -> None:
"""Log the message to the sentry hub as a breadcrumb
-
+
:param log_type: "e" (error), "i"(info), "d"(debug), "w"(warning) or "c"(critical) (can postfix with "_once")
:param message: String containing message to be logged
"""
diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py
index a4b17236dd..630c0abb1b 100755
--- a/plugins/SliceInfoPlugin/SliceInfo.py
+++ b/plugins/SliceInfoPlugin/SliceInfo.py
@@ -28,7 +28,7 @@ catalog = i18nCatalog("cura")
class SliceInfo(QObject, Extension):
"""This Extension runs in the background and sends several bits of information to the Ultimaker servers.
-
+
The data is only sent when the user in question gave permission to do so. All data is anonymous and
no model files are being sent (Just a SHA256 hash of the model).
"""
@@ -59,7 +59,7 @@ class SliceInfo(QObject, Extension):
def messageActionTriggered(self, message_id, action_id):
"""Perform action based on user input.
-
+
Note that clicking "Disable" won't actually disable the data sending, but rather take the user to preferences where they can disable it.
"""
self._application.getPreferences().setValue("info/asked_send_slice_info", True)
diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py
index 4d1c812981..9a8e7f5dfe 100644
--- a/plugins/Toolbox/src/AuthorsModel.py
+++ b/plugins/Toolbox/src/AuthorsModel.py
@@ -73,7 +73,7 @@ class AuthorsModel(ListModel):
def setFilter(self, filter_dict: Dict[str, str]) -> None:
"""Set the filter of this model based on a string.
-
+
:param filter_dict: Dictionary to do the filtering by.
"""
if filter_dict != self._filter:
diff --git a/plugins/Toolbox/src/CloudSync/DiscrepanciesPresenter.py b/plugins/Toolbox/src/CloudSync/DiscrepanciesPresenter.py
index a168381efa..cee2f6318a 100644
--- a/plugins/Toolbox/src/CloudSync/DiscrepanciesPresenter.py
+++ b/plugins/Toolbox/src/CloudSync/DiscrepanciesPresenter.py
@@ -10,7 +10,7 @@ from .SubscribedPackagesModel import SubscribedPackagesModel
class DiscrepanciesPresenter(QObject):
"""Shows a list of packages to be added or removed. The user can select which packages to (un)install. The user's
-
+
choices are emitted on the `packageMutations` Signal.
"""
diff --git a/plugins/Toolbox/src/CloudSync/DownloadPresenter.py b/plugins/Toolbox/src/CloudSync/DownloadPresenter.py
index 11c1dffcb4..635cd89af2 100644
--- a/plugins/Toolbox/src/CloudSync/DownloadPresenter.py
+++ b/plugins/Toolbox/src/CloudSync/DownloadPresenter.py
@@ -18,7 +18,7 @@ from .SubscribedPackagesModel import SubscribedPackagesModel
class DownloadPresenter:
"""Downloads a set of packages from the Ultimaker Cloud Marketplace
-
+
use download() exactly once: should not be used for multiple sets of downloads since this class contains state
"""
diff --git a/plugins/Toolbox/src/CloudSync/LicensePresenter.py b/plugins/Toolbox/src/CloudSync/LicensePresenter.py
index 8701120cc5..9a68c93d71 100644
--- a/plugins/Toolbox/src/CloudSync/LicensePresenter.py
+++ b/plugins/Toolbox/src/CloudSync/LicensePresenter.py
@@ -45,7 +45,7 @@ class LicensePresenter(QObject):
def present(self, plugin_path: str, packages: Dict[str, Dict[str, str]]) -> None:
"""Show a license dialog for multiple packages where users can read a license and accept or decline them
-
+
:param plugin_path: Root directory of the Toolbox plugin
:param packages: Dict[package id, file path]
"""
diff --git a/plugins/Toolbox/src/CloudSync/RestartApplicationPresenter.py b/plugins/Toolbox/src/CloudSync/RestartApplicationPresenter.py
index 1242bd3b49..d0222029fd 100644
--- a/plugins/Toolbox/src/CloudSync/RestartApplicationPresenter.py
+++ b/plugins/Toolbox/src/CloudSync/RestartApplicationPresenter.py
@@ -5,7 +5,7 @@ from cura.CuraApplication import CuraApplication
class RestartApplicationPresenter:
"""Presents a dialog telling the user that a restart is required to apply changes
-
+
Since we cannot restart Cura, the app is closed instead when the button is clicked
"""
def __init__(self, app: CuraApplication) -> None:
diff --git a/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py b/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py
index 89f20815bf..5693b82ded 100644
--- a/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py
+++ b/plugins/Toolbox/src/CloudSync/SyncOrchestrator.py
@@ -18,7 +18,7 @@ from .SubscribedPackagesModel import SubscribedPackagesModel
class SyncOrchestrator(Extension):
"""Orchestrates the synchronizing of packages from the user account to the installed packages
-
+
Example flow:
- CloudPackageChecker compares a list of packages the user `subscribed` to in their account
@@ -68,7 +68,7 @@ class SyncOrchestrator(Extension):
def _onDownloadFinished(self, success_items: Dict[str, Dict[str, str]], error_items: List[str]) -> None:
"""Called when a set of packages have finished downloading
-
+
:param success_items:: Dict[package_id, Dict[str, str]]
:param error_items:: List[package_id]
"""
diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py
index 4cbabde07e..85811a9eb4 100644
--- a/plugins/Toolbox/src/PackagesModel.py
+++ b/plugins/Toolbox/src/PackagesModel.py
@@ -137,7 +137,7 @@ class PackagesModel(ListModel):
def setFilter(self, filter_dict: Dict[str, str]) -> None:
"""Set the filter of this model based on a string.
-
+
:param filter_dict: Dictionary to do the filtering by.
"""
if filter_dict != self._filter:
diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py
index 632af456b5..0ad9f7c89c 100644
--- a/plugins/Toolbox/src/Toolbox.py
+++ b/plugins/Toolbox/src/Toolbox.py
@@ -315,7 +315,7 @@ class Toolbox(QObject, Extension):
@pyqtSlot(str)
def checkPackageUsageAndUninstall(self, package_id: str) -> None:
"""Check package usage and uninstall
-
+
If the package is in use, you'll get a confirmation dialog to set everything to default
"""
@@ -359,7 +359,7 @@ class Toolbox(QObject, Extension):
@pyqtSlot()
def resetMaterialsQualitiesAndUninstall(self) -> None:
"""Uses "uninstall variables" to reset qualities and materials, then uninstall
-
+
It's used as an action on Confirm reset on Uninstall
"""
diff --git a/plugins/TrimeshReader/TrimeshReader.py b/plugins/TrimeshReader/TrimeshReader.py
index f746c55cc5..cbec2e2482 100644
--- a/plugins/TrimeshReader/TrimeshReader.py
+++ b/plugins/TrimeshReader/TrimeshReader.py
@@ -83,7 +83,7 @@ class TrimeshReader(MeshReader):
def _read(self, file_name: str) -> Union["SceneNode", List["SceneNode"]]:
"""Reads a file using Trimesh.
-
+
:param file_name: The file path. This is assumed to be one of the file
types that Trimesh can read. It will not be checked again.
:return: A scene node that contains the file's contents.
@@ -136,7 +136,7 @@ class TrimeshReader(MeshReader):
def _toMeshData(self, tri_node: trimesh.base.Trimesh, file_name: str = "") -> MeshData:
"""Converts a Trimesh to Uranium's MeshData.
-
+
:param tri_node: A Trimesh containing the contents of a file that was just read.
:param file_name: The full original filename used to watch for changes
:return: Mesh data from the Trimesh in a way that Uranium can understand it.
diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
index 939b9cce23..b8c5a30524 100644
--- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
+++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
@@ -37,7 +37,7 @@ I18N_CATALOG = i18nCatalog("cura")
class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
"""The cloud output device is a network output device that works remotely but has limited functionality.
-
+
Currently it only supports viewing the printer and print job status and adding a new job to the queue.
As such, those methods have been implemented here.
Note that this device represents a single remote cluster, not a list of multiple clusters.
@@ -60,7 +60,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def __init__(self, api_client: CloudApiClient, cluster: CloudClusterResponse, parent: QObject = None) -> None:
"""Creates a new cloud output device
-
+
:param api_client: The client that will run the API calls
:param cluster: The device response received from the cloud API.
:param parent: The optional parent of this output device.
@@ -165,7 +165,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _onStatusCallFinished(self, status: CloudClusterStatus) -> None:
"""Method called when HTTP request to status endpoint is finished.
-
+
Contains both printers and print jobs statuses in a single response.
"""
self._responseReceived()
@@ -202,7 +202,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _onPrintJobCreated(self, job: ExportFileJob) -> None:
"""Handler for when the print job was created locally.
-
+
It can now be sent over the cloud.
"""
output = job.getOutput()
@@ -217,7 +217,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _uploadPrintJob(self, job_response: CloudPrintJobResponse) -> None:
"""Uploads the mesh when the print job was registered with the cloud API.
-
+
:param job_response: The response received from the cloud API.
"""
if not self._tool_path:
@@ -236,7 +236,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _onPrintUploadCompleted(self, response: CloudPrintResponse) -> None:
"""Shows a message when the upload has succeeded
-
+
:param response: The response from the cloud API.
"""
self._progress.hide()
@@ -245,7 +245,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _onUploadError(self, message: str = None) -> None:
"""Displays the given message if uploading the mesh has failed
-
+
:param message: The message to display.
"""
self._progress.hide()
diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py
index 84698ff371..fa1271ab66 100644
--- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py
+++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py
@@ -22,7 +22,7 @@ from ..Models.Http.CloudClusterResponse import CloudClusterResponse
class CloudOutputDeviceManager:
"""The cloud output device manager is responsible for using the Ultimaker Cloud APIs to manage remote clusters.
-
+
Keeping all cloud related logic in this class instead of the UM3OutputDevicePlugin results in more readable code.
API spec is available on https://api.ultimaker.com/docs/connect/spec/.
"""
diff --git a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py
index 0287d72eb6..7fc1b4a7d3 100644
--- a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py
+++ b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py
@@ -32,7 +32,7 @@ class MeshFormatHandler:
@property
def preferred_format(self) -> Dict[str, Union[str, int, bool]]:
"""Chooses the preferred file format.
-
+
:return: A dict with the file format details, with the following keys:
{id: str, extension: str, description: str, mime_type: str, mode: int, hide_in_file_dialog: bool}
"""
@@ -41,7 +41,7 @@ class MeshFormatHandler:
@property
def writer(self) -> Optional[FileWriter]:
"""Gets the file writer for the given file handler and mime type.
-
+
:return: A file writer.
"""
return self._writer
@@ -84,7 +84,7 @@ class MeshFormatHandler:
def _getPreferredFormat(self, firmware_version: str) -> Dict[str, Union[str, int, bool]]:
"""Chooses the preferred file format for the given file handler.
-
+
:param firmware_version: The version of the firmware.
:return: A dict with the file format details.
"""
@@ -121,7 +121,7 @@ class MeshFormatHandler:
def _getWriter(self, mime_type: str) -> Optional[FileWriter]:
"""Gets the file writer for the given file handler and mime type.
-
+
:param mime_type: The mine type.
:return: A file writer.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Messages/PrintJobUploadProgressMessage.py b/plugins/UM3NetworkPrinting/src/Messages/PrintJobUploadProgressMessage.py
index b7ddf7f550..63fa037890 100644
--- a/plugins/UM3NetworkPrinting/src/Messages/PrintJobUploadProgressMessage.py
+++ b/plugins/UM3NetworkPrinting/src/Messages/PrintJobUploadProgressMessage.py
@@ -28,7 +28,7 @@ class PrintJobUploadProgressMessage(Message):
def update(self, percentage: int) -> None:
"""Updates the percentage of the uploaded.
-
+
:param percentage: The percentage amount (0-100).
"""
if not self._visible:
diff --git a/plugins/UM3NetworkPrinting/src/Models/BaseModel.py b/plugins/UM3NetworkPrinting/src/Models/BaseModel.py
index f1385a0270..92d7246489 100644
--- a/plugins/UM3NetworkPrinting/src/Models/BaseModel.py
+++ b/plugins/UM3NetworkPrinting/src/Models/BaseModel.py
@@ -20,7 +20,7 @@ class BaseModel:
def __eq__(self, other):
"""Checks whether the two models are equal.
-
+
:param other: The other model.
:return: True if they are equal, False if they are different.
"""
@@ -28,7 +28,7 @@ class BaseModel:
def __ne__(self, other) -> bool:
"""Checks whether the two models are different.
-
+
:param other: The other model.
:return: True if they are different, False if they are the same.
"""
@@ -42,7 +42,7 @@ class BaseModel:
@staticmethod
def parseModel(model_class: Type[T], values: Union[T, Dict[str, Any]]) -> T:
"""Parses a single model.
-
+
:param model_class: The model class.
:param values: The value of the model, which is usually a dictionary, but may also be already parsed.
:return: An instance of the model_class given.
@@ -54,7 +54,7 @@ class BaseModel:
@classmethod
def parseModels(cls, model_class: Type[T], values: List[Union[T, Dict[str, Any]]]) -> List[T]:
"""Parses a list of models.
-
+
:param model_class: The model class.
:param values: The value of the list. Each value is usually a dictionary, but may also be already parsed.
:return: A list of instances of the model_class given.
@@ -64,7 +64,7 @@ class BaseModel:
@staticmethod
def parseDate(date: Union[str, datetime]) -> datetime:
"""Parses the given date string.
-
+
:param date: The date to parse.
:return: The parsed date.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
index a108b8dc87..94f20b65c6 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
@@ -13,7 +13,7 @@ class CloudClusterResponse(BaseModel):
host_internal_ip: Optional[str] = None, host_version: Optional[str] = None,
friendly_name: Optional[str] = None, printer_type: str = "ultimaker3", **kwargs) -> None:
"""Creates a new cluster response object.
-
+
:param cluster_id: The secret unique ID, e.g. 'kBEeZWEifXbrXviO8mRYLx45P8k5lHVGs43XKvRniPg='.
:param host_guid: The unique identifier of the print cluster host, e.g. 'e90ae0ac-1257-4403-91ee-a44c9b7e8050'.
:param host_name: The name of the printer as configured during the Wi-Fi setup. Used as identifier for end users.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterStatus.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterStatus.py
index 10f7b0ce6b..5cd151d8ef 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterStatus.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterStatus.py
@@ -16,7 +16,7 @@ class CloudClusterStatus(BaseModel):
generated_time: Union[str, datetime],
**kwargs) -> None:
"""Creates a new cluster status model object.
-
+
:param printers: The latest status of each printer in the cluster.
:param print_jobs: The latest status of each print job in the cluster.
:param generated_time: The datetime when the object was generated on the server-side.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudError.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudError.py
index 97e7862ff6..05f303e5c9 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudError.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudError.py
@@ -11,7 +11,7 @@ class CloudError(BaseModel):
def __init__(self, id: str, code: str, title: str, http_status: str, detail: Optional[str] = None,
meta: Optional[Dict[str, Any]] = None, **kwargs) -> None:
"""Creates a new error object.
-
+
:param id: Unique identifier for this particular occurrence of the problem.
:param title: A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence
of the problem, except for purposes of localization.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobResponse.py
index ccc9ffb2fc..83cbb5a030 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobResponse.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobResponse.py
@@ -12,7 +12,7 @@ class CloudPrintJobResponse(BaseModel):
upload_url: Optional[str] = None, content_type: Optional[str] = None,
status_description: Optional[str] = None, slicing_details: Optional[dict] = None, **kwargs) -> None:
"""Creates a new print job response model.
-
+
:param job_id: The job unique ID, e.g. 'kBEeZWEifXbrXviO8mRYLx45P8k5lHVGs43XKvRniPg='.
:param status: The status of the print job.
:param status_description: Contains more details about the status, e.g. the cause of failures.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobUploadRequest.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobUploadRequest.py
index efa1efb7e4..7e108027d9 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobUploadRequest.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintJobUploadRequest.py
@@ -8,7 +8,7 @@ class CloudPrintJobUploadRequest(BaseModel):
def __init__(self, job_name: str, file_size: int, content_type: str, **kwargs) -> None:
"""Creates a new print job upload request.
-
+
:param job_name: The name of the print job.
:param file_size: The size of the file in bytes.
:param content_type: The content type of the print job (e.g. text/plain or application/gzip)
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintResponse.py
index ee2b8a307f..f8b3210210 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintResponse.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudPrintResponse.py
@@ -12,7 +12,7 @@ class CloudPrintResponse(BaseModel):
def __init__(self, job_id: str, status: str, generated_time: Union[str, datetime],
cluster_job_id: Optional[str] = None, **kwargs) -> None:
"""Creates a new print response object.
-
+
:param job_id: The unique ID of a print job inside of the cluster. This ID is generated by Cura Connect.
:param status: The status of the print request (queued or failed).
:param generated_time: The datetime when the object was generated on the server-side.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterBuildPlate.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterBuildPlate.py
index c81e0a372c..771389e102 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterBuildPlate.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterBuildPlate.py
@@ -8,7 +8,7 @@ class ClusterBuildPlate(BaseModel):
def __init__(self, type: str = "glass", **kwargs) -> None:
"""Create a new build plate
-
+
:param type: The type of build plate glass or aluminium
"""
self.type = type
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py
index 75ce234e23..529f3928fd 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py
@@ -11,14 +11,14 @@ from ..BaseModel import BaseModel
class ClusterPrintCoreConfiguration(BaseModel):
"""Class representing a cloud cluster printer configuration
-
+
Also used for representing slots in a Material Station (as from Cura's perspective these are the same).
"""
def __init__(self, extruder_index: int, material: Union[None, Dict[str, Any],
ClusterPrinterConfigurationMaterial] = None, print_core_id: Optional[str] = None, **kwargs) -> None:
"""Creates a new cloud cluster printer configuration object
-
+
:param extruder_index: The position of the extruder on the machine as list index. Numbered from left to right.
:param material: The material of a configuration object in a cluster printer. May be in a dict or an object.
:param nozzle_diameter: The diameter of the print core at this position in millimeters, e.g. '0.4'.
@@ -32,7 +32,7 @@ class ClusterPrintCoreConfiguration(BaseModel):
def updateOutputModel(self, model: ExtruderOutputModel) -> None:
"""Updates the given output model.
-
+
:param model: The output model to update.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py
index cdfa633170..0c83cd1b31 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConfigurationChange.py
@@ -12,7 +12,7 @@ class ClusterPrintJobConfigurationChange(BaseModel):
def __init__(self, type_of_change: str, target_id: str, origin_id: str, index: Optional[int] = None,
target_name: Optional[str] = None, origin_name: Optional[str] = None, **kwargs) -> None:
"""Creates a new print job constraint.
-
+
:param type_of_change: The type of configuration change, one of: "material", "print_core_change"
:param index: The hotend slot or extruder index to change
:param target_id: Target material guid or hotend id
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConstraint.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConstraint.py
index 258d940a03..5271130dd6 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConstraint.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobConstraint.py
@@ -10,7 +10,7 @@ class ClusterPrintJobConstraints(BaseModel):
def __init__(self, require_printer_name: Optional[str] = None, **kwargs) -> None:
"""Creates a new print job constraint.
-
+
:param require_printer_name: Unique name of the printer that this job should be printed on.
Should be one of the unique_name field values in the cluster, e.g. 'ultimakersystem-ccbdd30044ec'
"""
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobImpediment.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobImpediment.py
index 7beaf6f61f..3c9e03223a 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobImpediment.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobImpediment.py
@@ -8,7 +8,7 @@ class ClusterPrintJobImpediment(BaseModel):
def __init__(self, translation_key: str, severity: int, **kwargs) -> None:
"""Creates a new print job constraint.
-
+
:param translation_key: A string indicating a reason the print cannot be printed,
such as 'does_not_fit_in_build_volume'
:param severity: A number indicating the severity of the problem, with higher being more severe
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobStatus.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobStatus.py
index 9fb94ab12f..8c8b187288 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobStatus.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintJobStatus.py
@@ -35,7 +35,7 @@ class ClusterPrintJobStatus(BaseModel):
**kwargs) -> None:
"""Creates a new cloud print job status model.
-
+
:param assigned_to: The name of the printer this job is assigned to while being queued.
:param configuration: The required print core configurations of this print job.
:param constraints: Print job constraints object.
@@ -96,7 +96,7 @@ class ClusterPrintJobStatus(BaseModel):
def createOutputModel(self, controller: ClusterOutputController) -> UM3PrintJobOutputModel:
"""Creates an UM3 print job output model based on this cloud cluster print job.
-
+
:param printer: The output model of the printer
"""
@@ -115,7 +115,7 @@ class ClusterPrintJobStatus(BaseModel):
def updateOutputModel(self, model: UM3PrintJobOutputModel) -> None:
"""Updates an UM3 print job output model based on this cloud cluster print job.
-
+
:param model: The model to update.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py
index 62f99293d1..5d55f2f16b 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterConfigurationMaterial.py
@@ -16,7 +16,7 @@ class ClusterPrinterConfigurationMaterial(BaseModel):
material: Optional[str] = None, **kwargs) -> None:
"""Creates a new material configuration model.
-
+
:param brand: The brand of material in this print core, e.g. 'Ultimaker'.
:param color: The color of material in this print core, e.g. 'Blue'.
:param guid: he GUID of the material in this print core, e.g. '506c9f0d-e3aa-4bd4-b2d2-23e2425b1aa9'.
@@ -31,7 +31,7 @@ class ClusterPrinterConfigurationMaterial(BaseModel):
def createOutputModel(self) -> MaterialOutputModel:
"""Creates a material output model based on this cloud printer material.
-
+
A material is chosen that matches the current GUID. If multiple such
materials are available, read-only materials are preferred and the
material with the earliest alphabetical name will be selected.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStation.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStation.py
index 1929c2a388..b03a2291c4 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStation.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStation.py
@@ -13,7 +13,7 @@ class ClusterPrinterMaterialStation(BaseModel):
material_slots: List[Union[ClusterPrinterMaterialStationSlot, Dict[str, Any]]] = None,
**kwargs) -> None:
"""Creates a new Material Station status.
-
+
:param status: The status of the material station.
:param: supported: Whether the material station is supported on this machine or not.
:param material_slots: The active slots configurations of this material station.
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStationSlot.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStationSlot.py
index d41d6c14fc..11e2736ded 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStationSlot.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterMaterialStationSlot.py
@@ -11,7 +11,7 @@ class ClusterPrinterMaterialStationSlot(ClusterPrintCoreConfiguration):
def __init__(self, slot_index: int, compatible: bool, material_remaining: float,
material_empty: Optional[bool] = False, **kwargs) -> None:
"""Create a new material station slot object.
-
+
:param slot_index: The index of the slot in the material station (ranging 0 to 5).
:param compatible: Whether the configuration is compatible with the print core.
:param material_remaining: How much material is remaining on the spool (between 0 and 1, or -1 for missing data).
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py
index 3d342a519d..5b4d7fb161 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrinterStatus.py
@@ -29,7 +29,7 @@ class ClusterPrinterStatus(BaseModel):
build_plate: Union[Dict[str, Any], ClusterBuildPlate] = None,
material_station: Union[Dict[str, Any], ClusterPrinterMaterialStation] = None, **kwargs) -> None:
"""Creates a new cluster printer status
-
+
:param enabled: A printer can be disabled if it should not receive new jobs. By default every printer is enabled.
:param firmware_version: Firmware version installed on the printer. Can differ for each printer in a cluster.
:param friendly_name: Human readable name of the printer. Can be used for identification purposes.
@@ -68,7 +68,7 @@ class ClusterPrinterStatus(BaseModel):
def createOutputModel(self, controller: PrinterOutputController) -> PrinterOutputModel:
"""Creates a new output model.
-
+
:param controller: - The controller of the model.
"""
@@ -82,7 +82,7 @@ class ClusterPrinterStatus(BaseModel):
def updateOutputModel(self, model: PrinterOutputModel) -> None:
"""Updates the given output model.
-
+
:param model: - The output model to update.
"""
@@ -121,7 +121,7 @@ class ClusterPrinterStatus(BaseModel):
def _getSlotsForExtruder(self, extruder_index: int) -> List[ClusterPrinterMaterialStationSlot]:
"""Create a list of Material Station slots for the given extruder index.
-
+
Returns a list with a single empty material slot if none are found to ensure we don't miss configurations.
"""
@@ -136,7 +136,7 @@ class ClusterPrinterStatus(BaseModel):
@staticmethod
def _isSupportedConfiguration(slot: ClusterPrinterMaterialStationSlot, extruder_index: int) -> bool:
"""Check if a configuration is supported in order to make it selectable by the user.
-
+
We filter out any slot that is not supported by the extruder index, print core type or if the material is empty.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py
index 7d6b260b90..d1840bf90c 100644
--- a/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py
+++ b/plugins/UM3NetworkPrinting/src/Network/ClusterApiClient.py
@@ -32,7 +32,7 @@ class ClusterApiClient:
def __init__(self, address: str, on_error: Callable) -> None:
"""Initializes a new cluster API client.
-
+
:param address: The network address of the cluster to call.
:param on_error: The callback to be called whenever we receive errors from the server.
"""
@@ -43,7 +43,7 @@ class ClusterApiClient:
def getSystem(self, on_finished: Callable) -> None:
"""Get printer system information.
-
+
:param on_finished: The callback in case the response is successful.
"""
url = "{}/system".format(self.PRINTER_API_PREFIX)
@@ -52,7 +52,7 @@ class ClusterApiClient:
def getMaterials(self, on_finished: Callable[[List[ClusterMaterial]], Any]) -> None:
"""Get the installed materials on the printer.
-
+
:param on_finished: The callback in case the response is successful.
"""
url = "{}/materials".format(self.CLUSTER_API_PREFIX)
@@ -61,7 +61,7 @@ class ClusterApiClient:
def getPrinters(self, on_finished: Callable[[List[ClusterPrinterStatus]], Any]) -> None:
"""Get the printers in the cluster.
-
+
:param on_finished: The callback in case the response is successful.
"""
url = "{}/printers".format(self.CLUSTER_API_PREFIX)
@@ -70,7 +70,7 @@ class ClusterApiClient:
def getPrintJobs(self, on_finished: Callable[[List[ClusterPrintJobStatus]], Any]) -> None:
"""Get the print jobs in the cluster.
-
+
:param on_finished: The callback in case the response is successful.
"""
url = "{}/print_jobs".format(self.CLUSTER_API_PREFIX)
@@ -112,7 +112,7 @@ class ClusterApiClient:
def _createEmptyRequest(self, path: str, content_type: Optional[str] = "application/json") -> QNetworkRequest:
"""We override _createEmptyRequest in order to add the user credentials.
-
+
:param url: The URL to request
:param content_type: The type of the body contents.
"""
@@ -126,7 +126,7 @@ class ClusterApiClient:
@staticmethod
def _parseReply(reply: QNetworkReply) -> Tuple[int, Dict[str, Any]]:
"""Parses the given JSON network reply into a status code and a dictionary, handling unexpected errors as well.
-
+
:param reply: The reply from the server.
:return: A tuple with a status code and a dictionary.
"""
@@ -141,7 +141,7 @@ class ClusterApiClient:
def _parseModels(self, response: Dict[str, Any], on_finished: Union[Callable[[ClusterApiClientModel], Any],
Callable[[List[ClusterApiClientModel]], Any]], model_class: Type[ClusterApiClientModel]) -> None:
"""Parses the given models and calls the correct callback depending on the result.
-
+
:param response: The response from the server, after being converted to a dict.
:param on_finished: The callback in case the response is successful.
:param model_class: The type of the model to convert the response to. It may either be a single record or a list.
@@ -163,7 +163,7 @@ class ClusterApiClient:
Callable[[List[ClusterApiClientModel]], Any]], model: Type[ClusterApiClientModel] = None,
) -> None:
"""Creates a callback function so that it includes the parsing of the response into the correct model.
-
+
The callback is added to the 'finished' signal of the reply.
:param reply: The reply that should be listened to.
:param on_finished: The callback in case the response is successful.
diff --git a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py
index ea120f8978..48e552241a 100644
--- a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py
+++ b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDevice.py
@@ -98,7 +98,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def setJobState(self, print_job_uuid: str, action: str) -> None:
"""Set the remote print job state.
-
+
:param print_job_uuid: The UUID of the print job to set the state for.
:param action: The action to undertake ('pause', 'resume', 'abort').
"""
@@ -118,7 +118,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def sendMaterialProfiles(self) -> None:
"""Sync the material profiles in Cura with the printer.
-
+
This gets called when connecting to a printer as well as when sending a print.
"""
job = SendMaterialJob(device = self)
@@ -143,14 +143,14 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
@pyqtSlot(str, name="selectTargetPrinter")
def selectTargetPrinter(self, unique_name: str = "") -> None:
"""Allows the user to choose a printer to print with from the printer selection dialogue.
-
+
:param unique_name: The unique name of the printer to target.
"""
self._startPrintJobUpload(unique_name if unique_name != "" else None)
def _onPrintJobCreated(self, job: ExportFileJob) -> None:
"""Handler for when the print job was created locally.
-
+
It can now be sent over the network.
"""
@@ -208,7 +208,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
def _onUploadError(self, message: str = None) -> None:
"""Displays the given message if uploading the mesh has failed
-
+
:param message: The message to display.
"""
diff --git a/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py b/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py
index 90aa68eedb..2740f86605 100644
--- a/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py
+++ b/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
class SendMaterialJob(Job):
"""Asynchronous job to send material profiles to the printer.
-
+
This way it won't freeze up the interface while sending those materials.
"""
@@ -40,7 +40,7 @@ class SendMaterialJob(Job):
def _sendMissingMaterials(self, remote_materials_by_guid: Dict[str, ClusterMaterial]) -> None:
"""Determine which materials should be updated and send them to the printer.
-
+
:param remote_materials_by_guid: The remote materials by GUID.
"""
local_materials_by_guid = self._getLocalMaterials()
@@ -57,7 +57,7 @@ class SendMaterialJob(Job):
def _determineMaterialsToSend(local_materials: Dict[str, LocalMaterial],
remote_materials: Dict[str, ClusterMaterial]) -> Set[str]:
"""From the local and remote materials, determine which ones should be synchronized.
-
+
Makes a Set of id's containing only the id's of the materials that are not on the printer yet or the ones that
are newer in Cura.
:param local_materials: The local materials by GUID.
@@ -72,7 +72,7 @@ class SendMaterialJob(Job):
def _sendMaterials(self, materials_to_send: Set[str]) -> None:
"""Send the materials to the printer.
-
+
The given materials will be loaded from disk en sent to to printer.
The given id's will be matched with filenames of the locally stored materials.
:param materials_to_send: A set with id's of materials that must be sent.
@@ -97,7 +97,7 @@ class SendMaterialJob(Job):
def _sendMaterialFile(self, file_path: str, file_name: str, material_id: str) -> None:
"""Send a single material file to the printer.
-
+
Also add the material signature file if that is available.
:param file_path: The path of the material file.
:param file_name: The name of the material file.
@@ -143,7 +143,7 @@ class SendMaterialJob(Job):
@staticmethod
def _getLocalMaterials() -> Dict[str, LocalMaterial]:
"""Retrieves a list of local materials
-
+
Only the new newest version of the local materials is returned
:return: a dictionary of LocalMaterial objects by GUID
"""
diff --git a/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py b/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py
index b41cd7d151..d59f2f2893 100644
--- a/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py
+++ b/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py
@@ -14,7 +14,7 @@ from cura.CuraApplication import CuraApplication
class ZeroConfClient:
"""The ZeroConfClient handles all network discovery logic.
-
+
It emits signals when new network services were found or disappeared.
"""
@@ -34,7 +34,7 @@ class ZeroConfClient:
def start(self) -> None:
"""The ZeroConf service changed requests are handled in a separate thread so we don't block the UI.
-
+
We can also re-schedule the requests when they fail to get detailed service info.
Any new or re-reschedule requests will be appended to the request queue and the thread will process them.
"""
@@ -108,7 +108,7 @@ class ZeroConfClient:
def _onServiceChanged(self, zero_conf: Zeroconf, service_type: str, name: str,
state_change: ServiceStateChange) -> bool:
"""Handler for zeroConf detection.
-
+
Return True or False indicating if the process succeeded.
Note that this function can take over 3 seconds to complete. Be careful calling it from the main thread.
"""
diff --git a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py
index 72b2da33cc..44dbfbb5f5 100644
--- a/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py
+++ b/plugins/UM3NetworkPrinting/src/UM3OutputDevicePlugin.py
@@ -69,7 +69,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
"""Remove a manually connected networked printer."""
self._network_output_device_manager.removeManualDevice(key, address)
-
+
def getDiscoveredDevices(self) -> Dict[str, LocalClusterOutputDevice]:
"""Get the discovered devices from the local network."""
diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterAction.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterAction.py
index dd3f3939ed..772a9d1973 100644
--- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterAction.py
+++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterAction.py
@@ -17,7 +17,7 @@ I18N_CATALOG = i18nCatalog("cura")
class UltimakerNetworkedPrinterAction(MachineAction):
"""Machine action that allows to connect the active machine to a networked devices.
-
+
TODO: in the future this should be part of the new discovery workflow baked into Cura.
"""
diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py
index 8090177b83..13aa0d7063 100644
--- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py
+++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py
@@ -24,7 +24,7 @@ from .Models.Http.ClusterPrintJobStatus import ClusterPrintJobStatus
class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
"""Output device class that forms the basis of Ultimaker networked printer output devices.
-
+
Currently used for local networking and cloud printing using Ultimaker Connect.
This base class primarily contains all the Qt properties and slots needed for the monitor page to work.
"""
@@ -218,7 +218,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
def _checkStillConnected(self) -> None:
"""Check if we're still connected by comparing the last timestamps for network response and the current time.
-
+
This implementation is similar to the base NetworkedPrinterOutputDevice, but is tweaked slightly.
Re-connecting is handled automatically by the output device managers in this plugin.
TODO: it would be nice to have this logic in the managers, but connecting those with signals causes crashes.
@@ -233,7 +233,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
def _reconnectForActiveMachine(self) -> None:
"""Reconnect for the active output device.
-
+
Does nothing if the device is not meant for the active machine.
"""
active_machine = CuraApplication.getInstance().getGlobalContainerStack()
@@ -301,7 +301,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
def _updatePrintJobs(self, remote_jobs: List[ClusterPrintJobStatus]) -> None:
"""Updates the local list of print jobs with the list received from the cluster.
-
+
:param remote_jobs: The print jobs received from the cluster.
"""
self._responseReceived()
@@ -336,7 +336,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
def _createPrintJobModel(self, remote_job: ClusterPrintJobStatus) -> UM3PrintJobOutputModel:
"""Create a new print job model based on the remote status of the job.
-
+
:param remote_job: The remote print job data.
"""
model = remote_job.createOutputModel(ClusterOutputController(self))
diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py
index 2e52a89713..bfc5385a81 100644
--- a/plugins/USBPrinting/USBPrinterOutputDevice.py
+++ b/plugins/USBPrinting/USBPrinterOutputDevice.py
@@ -118,7 +118,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
def requestWrite(self, nodes: List["SceneNode"], file_name: Optional[str] = None, limit_mimetypes: bool = False,
file_handler: Optional["FileHandler"] = None, filter_by_machine: bool = False, **kwargs) -> None:
"""Request the current scene to be sent to a USB-connected printer.
-
+
:param nodes: A collection of scene nodes to send. This is ignored.
:param file_name: A suggestion for a file name to write.
:param filter_by_machine: Whether to filter MIME types by machine. This
@@ -148,7 +148,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
def _printGCode(self, gcode: str):
"""Start a print based on a g-code.
-
+
:param gcode: The g-code to print.
"""
self._gcode.clear()
diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py
index 3ee43e071e..c5a017db7f 100644
--- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py
+++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py
@@ -110,7 +110,7 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin):
def getSerialPortList(self, only_list_usb = False):
"""Create a list of serial ports on the system.
-
+
:param only_list_usb: If true, only usb ports are listed
"""
base_list = []
diff --git a/plugins/USBPrinting/avr_isp/intelHex.py b/plugins/USBPrinting/avr_isp/intelHex.py
index 671f1788f7..fc410882dd 100644
--- a/plugins/USBPrinting/avr_isp/intelHex.py
+++ b/plugins/USBPrinting/avr_isp/intelHex.py
@@ -31,7 +31,7 @@ def readHex(filename):
check_sum &= 0xFF
if check_sum != 0:
raise Exception("Checksum error in hex file: " + line)
-
+
if rec_type == 0:#Data record
while len(data) < addr + rec_len:
data.append(0)
diff --git a/plugins/USBPrinting/avr_isp/ispBase.py b/plugins/USBPrinting/avr_isp/ispBase.py
index 077cfc36e6..9ba3a65b47 100644
--- a/plugins/USBPrinting/avr_isp/ispBase.py
+++ b/plugins/USBPrinting/avr_isp/ispBase.py
@@ -22,7 +22,7 @@ class IspBase():
if not self.chip:
raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")
self.chipErase()
-
+
Logger.log("d", "Flashing %i bytes", len(flash_data))
self.writeFlash(flash_data)
Logger.log("d", "Verifying %i bytes", len(flash_data))
diff --git a/plugins/USBPrinting/avr_isp/stk500v2.py b/plugins/USBPrinting/avr_isp/stk500v2.py
index dbfc8dc756..2b1a86155c 100644
--- a/plugins/USBPrinting/avr_isp/stk500v2.py
+++ b/plugins/USBPrinting/avr_isp/stk500v2.py
@@ -56,7 +56,7 @@ class Stk500v2(ispBase.IspBase):
self.close()
raise
self.serial.timeout = 5
-
+
def close(self):
if self.serial is not None:
self.serial.close()
diff --git a/plugins/UltimakerMachineActions/BedLevelMachineAction.py b/plugins/UltimakerMachineActions/BedLevelMachineAction.py
index 7d2eb74f84..f76e0c6746 100644
--- a/plugins/UltimakerMachineActions/BedLevelMachineAction.py
+++ b/plugins/UltimakerMachineActions/BedLevelMachineAction.py
@@ -16,7 +16,7 @@ catalog = i18nCatalog("cura")
class BedLevelMachineAction(MachineAction):
"""A simple action to handle manual bed leveling procedure for printers that don't have it on the firmware.
-
+
This is currently only used by the Ultimaker Original+
"""
diff --git a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py
index 39d02c078c..0741312011 100644
--- a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py
+++ b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py
@@ -216,13 +216,13 @@ _creality_limited_quality_type = {
class VersionUpgrade41to42(VersionUpgrade):
"""Upgrades configurations from the state they were in at version 4.1 to the
-
+
state they should be in at version 4.2.
"""
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades instance containers to have the new version number.
-
+
This renames the renamed settings in the containers.
"""
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
@@ -262,7 +262,7 @@ class VersionUpgrade41to42(VersionUpgrade):
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades Preferences to have the new version number.
-
+
This renames the renamed settings in the list of visible settings.
"""
diff --git a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
index 7359e88179..73d6578c9b 100644
--- a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
+++ b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
@@ -59,7 +59,7 @@ _renamed_settings = {
class VersionUpgrade42to43(VersionUpgrade):
"""Upgrades configurations from the state they were in at version 4.2 to the
-
+
state they should be in at version 4.3.
"""
def upgradePreferences(self, serialized: str, filename: str):
@@ -79,14 +79,14 @@ class VersionUpgrade42to43(VersionUpgrade):
parser["general"]["visible_settings"] = ";".join(all_setting_keys)
parser["metadata"]["setting_version"] = "9"
-
+
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades instance containers to have the new version number.
-
+
This renames the renamed settings in the containers.
"""
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
diff --git a/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py b/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py
index 249f55a42c..ec0a767105 100644
--- a/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py
+++ b/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py
@@ -29,7 +29,7 @@ class VersionUpgrade43to44(VersionUpgrade):
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades Preferences to have the new version number.
-
+
This renames the renamed settings in the list of visible settings.
"""
@@ -45,7 +45,7 @@ class VersionUpgrade43to44(VersionUpgrade):
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades instance containers to have the new version number.
-
+
This renames the renamed settings in the containers.
"""
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
diff --git a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py
index df4f95d74d..00faa216eb 100644
--- a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py
+++ b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py
@@ -124,7 +124,7 @@ class VersionUpgrade44to45(VersionUpgrade):
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades Preferences to have the new version number.
-
+
This renames the renamed settings in the list of visible settings.
"""
@@ -140,7 +140,7 @@ class VersionUpgrade44to45(VersionUpgrade):
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades instance containers to have the new version number.
-
+
This renames the renamed settings in the containers.
"""
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py
index 0b21b57fef..7978c0cdba 100644
--- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py
+++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py
@@ -38,11 +38,11 @@ class XmlMaterialProfile(InstanceContainer):
@staticmethod
def xmlVersionToSettingVersion(xml_version: str) -> int:
"""Translates the version number in the XML files to the setting_version metadata entry.
-
+
Since the two may increment independently we need a way to say which
versions of the XML specification are compatible with our setting data
version numbers.
-
+
:param xml_version: The version number found in an XML file.
:return: The corresponding setting_version.
"""
@@ -56,7 +56,7 @@ class XmlMaterialProfile(InstanceContainer):
def setMetaDataEntry(self, key, value, apply_to_all = True):
"""set the meta data for all machine / variant combinations
-
+
The "apply_to_all" flag indicates whether this piece of metadata should be applied to all material containers
or just this specific container.
For example, when you change the material name, you want to apply it to all its derived containers, but for
@@ -95,7 +95,7 @@ class XmlMaterialProfile(InstanceContainer):
def setName(self, new_name):
"""Overridden from InstanceContainer, similar to setMetaDataEntry.
-
+
without this function the setName would only set the name of the specific nozzle / material / machine combination container
The function is a bit tricky. It will not set the name of all containers if it has the correct name itself.
"""
@@ -130,7 +130,7 @@ class XmlMaterialProfile(InstanceContainer):
def serialize(self, ignored_metadata_keys: Optional[Set[str]] = None):
"""Overridden from InstanceContainer
-
+
base file: common settings + supported machines
machine / variant combination: only changes for itself.
"""
@@ -1075,7 +1075,7 @@ class XmlMaterialProfile(InstanceContainer):
@classmethod
def getProductIdMap(cls) -> Dict[str, List[str]]:
"""Gets a mapping from product names in the XML files to their definition IDs.
-
+
This loads the mapping from a file.
"""
diff --git a/scripts/check_gcode_buffer.py b/scripts/check_gcode_buffer.py
index f35dd20c24..321b2439c0 100755
--- a/scripts/check_gcode_buffer.py
+++ b/scripts/check_gcode_buffer.py
@@ -89,7 +89,7 @@ def calc_acceleration_time_from_distance(initial_feedrate: float, distance: floa
def calc_intersection_distance(initial_feedrate: float, final_feedrate: float, acceleration: float, distance: float) -> float:
"""Calculates the point at which you must start braking.
-
+
This gives the distance from the start of a line at which you must start
decelerating (at a rate of `-acceleration`) if you started at speed
`initial_feedrate` and accelerated until this point and want to end at the
@@ -145,7 +145,7 @@ class Command:
def calculate_trapezoid(self, entry_factor, exit_factor):
"""Calculate the velocity-time trapezoid function for this move.
-
+
Each move has a three-part function mapping time to velocity.
"""
diff --git a/scripts/lionbridge_import.py b/scripts/lionbridge_import.py
index 0bd6c5a8af..0a7b63e9ac 100644
--- a/scripts/lionbridge_import.py
+++ b/scripts/lionbridge_import.py
@@ -11,7 +11,7 @@ uranium_files = {"uranium"}
def lionbridge_import(source: str) -> None:
"""Imports translation files from Lionbridge.
-
+
Lionbridge has a bit of a weird export feature. It exports it to the same
file type as what we imported, so that's a .pot file. However this .pot file
only contains the translations, so the header is completely empty. We need
@@ -48,7 +48,7 @@ def lionbridge_import(source: str) -> None:
def destination_cura() -> str:
"""Gets the destination path to copy the translations for Cura to.
-
+
:return: Destination path for Cura.
"""
return os.path.abspath(os.path.join(__file__, "..", "..", "resources", "i18n"))
@@ -56,7 +56,7 @@ def destination_cura() -> str:
def destination_uranium() -> str:
"""Gets the destination path to copy the translations for Uranium to.
-
+
:return: Destination path for Uranium.
"""
try:
@@ -75,7 +75,7 @@ def destination_uranium() -> str:
def merge(source: str, destination: str) -> str:
"""Merges translations from the source file into the destination file if they
-
+
were missing in the destination file.
:param source: The contents of the source .po file.
:param destination: The contents of the destination .po file.
@@ -133,7 +133,7 @@ def merge(source: str, destination: str) -> str:
def find_translation(source: str, msgctxt: str, msgid: str) -> str:
"""Finds a translation in the source file.
-
+
:param source: The contents of the source .po file.
:param msgctxt: The ctxt of the translation to find.
:param msgid: The id of the translation to find.
diff --git a/tests/Machines/TestMachineNode.py b/tests/Machines/TestMachineNode.py
index 3b0822770b..cb1d4005ec 100644
--- a/tests/Machines/TestMachineNode.py
+++ b/tests/Machines/TestMachineNode.py
@@ -29,7 +29,7 @@ def container_registry():
@pytest.fixture
def empty_machine_node():
"""Creates a machine node without anything underneath it. No sub-nodes.
-
+
For testing stuff with machine nodes without testing _loadAll(). You'll need
to add subnodes manually in your test.
"""
@@ -82,7 +82,7 @@ def test_metadataProperties(container_registry):
def test_getQualityGroupsBothExtrudersAvailable(empty_machine_node):
"""Test getting quality groups when there are quality profiles available for
-
+
the requested configurations on two extruders.
"""
@@ -130,7 +130,7 @@ def test_getQualityGroupsBothExtrudersAvailable(empty_machine_node):
def test_getQualityGroupsAvailability(empty_machine_node):
"""Test the "is_available" flag on quality groups.
-
+
If a profile is available for a quality type on an extruder but not on all
extruders, there should be a quality group for it but it should not be made
available.
diff --git a/tests/Machines/TestVariantNode.py b/tests/Machines/TestVariantNode.py
index 96084001c1..7f06ad468c 100644
--- a/tests/Machines/TestVariantNode.py
+++ b/tests/Machines/TestVariantNode.py
@@ -52,7 +52,7 @@ def machine_node():
@pytest.fixture
def empty_variant_node(machine_node):
"""Constructs a variant node without any subnodes.
-
+
This is useful for performing tests on VariantNode without being dependent
on how _loadAll works.
"""
@@ -137,7 +137,7 @@ def test_materialAdded_update(container_registry, machine_node, metadata, change
def test_preferredMaterialExactMatch(empty_variant_node):
"""Tests the preferred material when the exact base file is available in the
-
+
materials list for this node.
"""
empty_variant_node.materials = {
@@ -151,7 +151,7 @@ def test_preferredMaterialExactMatch(empty_variant_node):
def test_preferredMaterialSubmaterial(empty_variant_node):
"""Tests the preferred material when a submaterial is available in the
-
+
materials list for this node.
"""
empty_variant_node.materials = {
diff --git a/tests/Settings/MockContainer.py b/tests/Settings/MockContainer.py
index 8bb570bae1..bb99710ef6 100644
--- a/tests/Settings/MockContainer.py
+++ b/tests/Settings/MockContainer.py
@@ -7,7 +7,7 @@ from UM.Signal import Signal
class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
"""Fake container class to add to the container registry.
-
+
This allows us to test the container registry without testing the container
class. If something is wrong in the container class it won't influence this
test.
@@ -15,7 +15,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def __init__(self, metadata = None):
"""Initialise a new definition container.
-
+
The container will have the specified ID and all metadata in the
provided dictionary.
"""
@@ -29,7 +29,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getId(self):
"""Gets the ID that was provided at initialisation.
-
+
:return: The ID of the container.
"""
@@ -37,10 +37,10 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getMetaData(self):
"""Gets all metadata of this container.
-
+
This returns the metadata dictionary that was provided in the
constructor of this mock container.
-
+
:return: The metadata for this container.
"""
@@ -48,7 +48,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getMetaDataEntry(self, entry, default = None):
"""Gets a metadata entry from the metadata dictionary.
-
+
:param key: The key of the metadata entry.
:return: The value of the metadata entry, or None if there is no such
entry.
@@ -60,7 +60,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getName(self):
"""Gets a human-readable name for this container.
-
+
:return: The name from the metadata, or "MockContainer" if there was no
name provided.
"""
@@ -69,14 +69,14 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
@property
def isEnabled(self):
"""Get whether a container stack is enabled or not.
-
+
:return: Always returns True.
"""
return True
def isReadOnly(self):
"""Get whether the container item is stored on a read only location in the filesystem.
-
+
:return: Always returns False
"""
@@ -110,9 +110,9 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getValue(self, key):
"""Get the value of a container item.
-
+
Since this mock container cannot contain any items, it always returns None.
-
+
:return: Always returns None.
"""
@@ -120,7 +120,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def hasProperty(self, key, property_name):
"""Get whether the container item has a specific property.
-
+
This method is not implemented in the mock container.
"""
@@ -128,7 +128,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def serialize(self, ignored_metadata_keys = None):
"""Serializes the container to a string representation.
-
+
This method is not implemented in the mock container.
"""
@@ -136,7 +136,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def deserialize(self, serialized, file_name: Optional[str] = None):
"""Deserializes the container from a string representation.
-
+
This method is not implemented in the mock container.
"""
diff --git a/tests/Settings/TestDefinitionContainer.py b/tests/Settings/TestDefinitionContainer.py
index f2a9c0d245..8622db26ee 100644
--- a/tests/Settings/TestDefinitionContainer.py
+++ b/tests/Settings/TestDefinitionContainer.py
@@ -89,7 +89,7 @@ def assertIsDefinitionValid(definition_container, file_path):
@pytest.mark.parametrize("file_path", definition_filepaths)
def test_validateOverridingDefaultValue(file_path: str):
"""Tests whether setting values are not being hidden by parent containers.
-
+
When a definition container defines a "default_value" but inherits from a
definition that defines a "value", the "default_value" is ineffective. This
test fails on those things.
@@ -135,7 +135,7 @@ def getInheritedSettings(definition_id: str) -> Dict[str, Any]:
def flattenSettings(settings: Dict[str, Any]) -> Dict[str, Any]:
"""Put all settings in the main dictionary rather than in children dicts.
-
+
:param settings: Nested settings. The keys are the setting IDs. The values
are dictionaries of properties per setting, including the "children" property.
:return: A dictionary of settings by key. Each setting is a dictionary of properties.
@@ -152,7 +152,7 @@ def flattenSettings(settings: Dict[str, Any]) -> Dict[str, Any]:
def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, Any]:
"""Make one dictionary override the other. Nested dictionaries override each
-
+
other in the same way.
:param base: A dictionary of settings that will get overridden by the other.
:param overrides: A dictionary of settings that will override the other.
@@ -176,7 +176,7 @@ def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, An
@pytest.mark.parametrize("file_path", definition_filepaths)
def test_noId(file_path: str):
"""Verifies that definition contains don't have an ID field.
-
+
ID fields are legacy. They should not be used any more. This is legacy that
people don't seem to be able to get used to.
"""
diff --git a/tests/Settings/TestExtruderStack.py b/tests/Settings/TestExtruderStack.py
index 0af0f1dcf3..c5ecdea5c4 100644
--- a/tests/Settings/TestExtruderStack.py
+++ b/tests/Settings/TestExtruderStack.py
@@ -16,7 +16,7 @@ from cura.Settings.cura_empty_instance_containers import empty_container
def getInstanceContainer(container_type) -> InstanceContainer:
"""Gets an instance container with a specified container type.
-
+
:param container_type: The type metadata for the instance container.
:return: An instance container instance.
"""
diff --git a/tests/Settings/TestGlobalStack.py b/tests/Settings/TestGlobalStack.py
index 391013233d..3c509bf8c8 100755
--- a/tests/Settings/TestGlobalStack.py
+++ b/tests/Settings/TestGlobalStack.py
@@ -18,7 +18,7 @@ from cura.Settings.cura_empty_instance_containers import empty_container
def getInstanceContainer(container_type) -> InstanceContainer:
"""Gets an instance container with a specified container type.
-
+
:param container_type: The type metadata for the instance container.
:return: An instance container instance.
"""
@@ -219,7 +219,7 @@ def test_constrainDefinitionValid(container, global_stack):
def test_deserializeCompletesEmptyContainers(global_stack):
"""Tests whether deserialising completes the missing containers with empty ones. The initial containers are just the
-
+
definition and the definition_changes (that cannot be empty after CURA-5281)
"""