Browse Source

Remove trailing whitespace from Python files

Nino van Hooff 4 years ago
parent
commit
89f0970a88

+ 2 - 2
cmake/mod_bundled_packages_json.py

@@ -13,7 +13,7 @@ import sys
 
 
 def find_json_files(work_dir: str) -> list:
 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.
     """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.
     :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.
     :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:
 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.
     """Removes the given entries from the given JSON file. The file will modified in-place.
-    
+
     :param file_path: The JSON file to modify.
     :param file_path: The JSON file to modify.
     :param entries: A list of strings as entries to remove.
     :param entries: A list of strings as entries to remove.
     :return: None
     :return: None

+ 4 - 4
cura/API/Backups.py

@@ -10,9 +10,9 @@ if TYPE_CHECKING:
 
 
 class Backups:
 class Backups:
     """The back-ups API provides a version-proof bridge between Cura's
     """The back-ups API provides a version-proof bridge between Cura's
-    
+
     BackupManager and plug-ins that hook into it.
     BackupManager and plug-ins that hook into it.
-    
+
     Usage:
     Usage:
 
 
     .. code-block:: python
     .. code-block:: python
@@ -28,7 +28,7 @@ class Backups:
 
 
     def createBackup(self) -> Tuple[Optional[bytes], Optional[Dict[str, Any]]]:
     def createBackup(self) -> Tuple[Optional[bytes], Optional[Dict[str, Any]]]:
         """Create a new back-up using the BackupsManager.
         """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.
         :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:
     def restoreBackup(self, zip_file: bytes, meta_data: Dict[str, Any]) -> None:
         """Restore a back-up using the BackupsManager.
         """Restore a back-up using the BackupsManager.
-        
+
         :param zip_file: A ZIP file containing the actual back-up data.
         :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.
         :param meta_data: Some metadata needed for restoring a back-up, like the Cura version number.
         """
         """

+ 4 - 4
cura/API/Interface/Settings.py

@@ -10,9 +10,9 @@ if TYPE_CHECKING:
 class Settings:
 class Settings:
     """The Interface.Settings API provides a version-proof bridge
     """The Interface.Settings API provides a version-proof bridge
      between Cura's
      between Cura's
-    
+
     (currently) sidebar UI and plug-ins that hook into it.
     (currently) sidebar UI and plug-ins that hook into it.
-    
+
     Usage:
     Usage:
 
 
     .. code-block:: python
     .. code-block:: python
@@ -34,7 +34,7 @@ class Settings:
 
 
     def addContextMenuItem(self, menu_item: dict) -> None:
     def addContextMenuItem(self, menu_item: dict) -> None:
         """Add items to the sidebar context menu.
         """Add items to the sidebar context menu.
-        
+
         :param menu_item: dict containing the menu item to add.
         :param menu_item: dict containing the menu item to add.
         """
         """
 
 
@@ -42,7 +42,7 @@ class Settings:
 
 
     def getContextMenuItems(self) -> list:
     def getContextMenuItems(self) -> list:
         """Get all custom items currently added to the sidebar context menu.
         """Get all custom items currently added to the sidebar context menu.
-        
+
         :return: List containing all custom context menu items.
         :return: List containing all custom context menu items.
         """
         """
 
 

+ 2 - 2
cura/API/Interface/__init__.py

@@ -11,9 +11,9 @@ if TYPE_CHECKING:
 
 
 class Interface:
 class Interface:
     """The Interface class serves as a common root for the specific API
     """The Interface class serves as a common root for the specific API
-    
+
     methods for each interface element.
     methods for each interface element.
-    
+
     Usage:
     Usage:
 
 
     .. code-block:: python
     .. code-block:: python

+ 4 - 4
cura/Arranging/ShapeArray.py

@@ -23,7 +23,7 @@ class ShapeArray:
     @classmethod
     @classmethod
     def fromPolygon(cls, vertices: numpy.array, scale: float = 1) -> "ShapeArray":
     def fromPolygon(cls, vertices: numpy.array, scale: float = 1) -> "ShapeArray":
         """Instantiate from a bunch of vertices
         """Instantiate from a bunch of vertices
-        
+
         :param vertices:
         :param vertices:
         :param scale:  scale the coordinates
         :param scale:  scale the coordinates
         :return: a shape array instantiated from a bunch of vertices
         :return: a shape array instantiated from a bunch of vertices
@@ -52,7 +52,7 @@ class ShapeArray:
     @classmethod
     @classmethod
     def fromNode(cls, node: "SceneNode", min_offset: float, scale: float = 0.5, include_children: bool = False) -> Tuple[Optional["ShapeArray"], Optional["ShapeArray"]]:
     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.
         """Instantiate an offset and hull ShapeArray from a scene node.
-        
+
         :param node: source node where the convex hull must be present
         :param node: source node where the convex hull must be present
         :param min_offset: offset for the offset ShapeArray
         :param min_offset: offset for the offset ShapeArray
         :param scale: scale the coordinates
         :param scale: scale the coordinates
@@ -100,7 +100,7 @@ class ShapeArray:
     @classmethod
     @classmethod
     def arrayFromPolygon(cls, shape: Tuple[int, int], vertices: numpy.array) -> numpy.array:
     def arrayFromPolygon(cls, shape: Tuple[int, int], vertices: numpy.array) -> numpy.array:
         """Create :py:class:`numpy.ndarray` with dimensions defined by shape
         """Create :py:class:`numpy.ndarray` with dimensions defined by shape
-        
+
         Fills polygon defined by vertices with ones, all other values zero
         Fills polygon defined by vertices with ones, all other values zero
         Only works correctly for convex hull vertices
         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>`_
         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
     @classmethod
     def _check(cls, p1: numpy.array, p2: numpy.array, base_array: numpy.array) -> Optional[numpy.array]:
     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
         """Return indices that mark one side of the line, used by arrayFromPolygon
-        
+
         Uses the line defined by p1 and p2 to check array of
         Uses the line defined by p1 and p2 to check array of
         input indices against interpolated value
         input indices against interpolated value
         Returns boolean array, with True inside and False outside of shape
         Returns boolean array, with True inside and False outside of shape

+ 5 - 5
cura/Backups/Backup.py

@@ -20,7 +20,7 @@ if TYPE_CHECKING:
 
 
 class Backup:
 class Backup:
     """The back-up class holds all data about a back-up.
     """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.
     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
         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
         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])
         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.
         # Store the archive and metadata so the BackupManager can fetch them when needed.
         self.zip_file = buffer.getvalue()
         self.zip_file = buffer.getvalue()
         self.meta_data = {
         self.meta_data = {
@@ -81,7 +81,7 @@ class Backup:
 
 
     def _makeArchive(self, buffer: "io.BytesIO", root_path: str) -> Optional[ZipFile]:
     def _makeArchive(self, buffer: "io.BytesIO", root_path: str) -> Optional[ZipFile]:
         """Make a full archive from the given root path with the given name.
         """Make a full archive from the given root path with the given name.
-        
+
         :param root_path: The root directory to archive recursively.
         :param root_path: The root directory to archive recursively.
         :return: The archive as bytes.
         :return: The archive as bytes.
         """
         """
@@ -111,7 +111,7 @@ class Backup:
 
 
     def restore(self) -> bool:
     def restore(self) -> bool:
         """Restore this back-up.
         """Restore this back-up.
-        
+
         :return: Whether we had success or not.
         :return: Whether we had success or not.
         """
         """
 
 
@@ -151,7 +151,7 @@ class Backup:
     @staticmethod
     @staticmethod
     def _extractArchive(archive: "ZipFile", target_path: str) -> bool:
     def _extractArchive(archive: "ZipFile", target_path: str) -> bool:
         """Extract the whole archive to the given target path.
         """Extract the whole archive to the given target path.
-        
+
         :param archive: The archive as ZipFile.
         :param archive: The archive as ZipFile.
         :param target_path: The target path.
         :param target_path: The target path.
         :return: Whether we had success or not.
         :return: Whether we had success or not.

+ 11 - 11
cura/BuildVolume.py

@@ -166,7 +166,7 @@ class BuildVolume(SceneNode):
 
 
     def _updateNodeListeners(self, node: SceneNode):
     def _updateNodeListeners(self, node: SceneNode):
         """Updates the listeners that listen for changes in per-mesh stacks.
         """Updates the listeners that listen for changes in per-mesh stacks.
-        
+
         :param node: The node for which the decorators changed.
         :param node: The node for which the decorators changed.
         """
         """
 
 
@@ -587,7 +587,7 @@ class BuildVolume(SceneNode):
     def _calculateExtraZClearance(self, extruders: List["ContainerStack"]) -> float:
     def _calculateExtraZClearance(self, extruders: List["ContainerStack"]) -> float:
         if not self._global_container_stack:
         if not self._global_container_stack:
             return 0
             return 0
-        
+
         extra_z = 0.0
         extra_z = 0.0
         for extruder in extruders:
         for extruder in extruders:
             if extruder.getProperty("retraction_hop_enabled", "value"):
             if extruder.getProperty("retraction_hop_enabled", "value"):
@@ -728,7 +728,7 @@ class BuildVolume(SceneNode):
 
 
     def _updateDisallowedAreasAndRebuild(self):
     def _updateDisallowedAreasAndRebuild(self):
         """Calls :py:meth:`cura.BuildVolume._updateDisallowedAreas` and makes sure the changes appear in the scene.
         """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
         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._updateDisallowedAreas` method itself shouldn't call
         :py:meth:`cura.BuildVolume.rebuild`, since there may be other changes before it needs to be rebuilt,
         :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):
     def _computeDisallowedAreasPrinted(self, used_extruders):
         """Computes the disallowed areas for objects that are printed with print features.
         """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.
         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.
         :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]]:
     def _computeDisallowedAreasPrimeBlob(self, border_size: float, used_extruders: List["ExtruderStack"]) -> Dict[str, List[Polygon]]:
         """Computes the disallowed areas for the prime blobs.
         """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
         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.
         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
         :param border_size: The size with which to offset the disallowed areas due to skirt, brim, travel avoid distance
          , etc.
          , etc.
         :param used_extruders: The extruder stacks to generate disallowed areas for.
         :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]]:
     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.
         """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
         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.
          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]:
     def _getSettingFromAllExtruders(self, setting_key: str) -> List[Any]:
         """Private convenience function to get a setting from every extruder.
         """Private convenience function to get a setting from every extruder.
-        
+
         For single extrusion machines, this gets the setting from the global stack.
         For single extrusion machines, this gets the setting from the global stack.
-        
+
         :return: A sequence of setting values, one for each extruder.
         :return: A sequence of setting values, one for each extruder.
         """
         """
 
 
@@ -1116,7 +1116,7 @@ class BuildVolume(SceneNode):
 
 
     def getEdgeDisallowedSize(self):
     def getEdgeDisallowedSize(self):
         """Calculate the disallowed radius around the edge.
         """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,
         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.
         such as bed adhesion (skirt/brim/raft) and travel avoid distance.
         """
         """

+ 1 - 1
cura/CrashHandler.py

@@ -237,7 +237,7 @@ class CrashHandler:
                 scope.set_tag("locale_os", self.data["locale_os"])
                 scope.set_tag("locale_os", self.data["locale_os"])
                 scope.set_tag("locale_cura", self.cura_locale)
                 scope.set_tag("locale_cura", self.cura_locale)
                 scope.set_tag("is_enterprise", ApplicationMetadata.IsEnterpriseVersion)
                 scope.set_tag("is_enterprise", ApplicationMetadata.IsEnterpriseVersion)
-    
+
                 scope.set_user({"id": str(uuid.getnode())})
                 scope.set_user({"id": str(uuid.getnode())})
 
 
         return group
         return group

+ 2 - 2
cura/CuraActions.py

@@ -78,7 +78,7 @@ class CuraActions(QObject):
     @pyqtSlot(int)
     @pyqtSlot(int)
     def multiplySelection(self, count: int) -> None:
     def multiplySelection(self, count: int) -> None:
         """Multiply all objects in the selection
         """Multiply all objects in the selection
-        
+
         :param count: The number of times to multiply the selection.
         :param count: The number of times to multiply the selection.
         """
         """
 
 
@@ -114,7 +114,7 @@ class CuraActions(QObject):
     @pyqtSlot(str)
     @pyqtSlot(str)
     def setExtruderForSelection(self, extruder_id: str) -> None:
     def setExtruderForSelection(self, extruder_id: str) -> None:
         """Set the extruder that should be used to print the selection.
         """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.
         :param extruder_id: The ID of the extruder stack to use for the selected objects.
         """
         """
 
 

+ 7 - 7
cura/CuraApplication.py

@@ -730,7 +730,7 @@ class CuraApplication(QtApplication):
 
 
     def _loadPlugins(self) -> None:
     def _loadPlugins(self) -> None:
         """Handle loading of all plugin types (and the backend explicitly)
         """Handle loading of all plugin types (and the backend explicitly)
-        
+
         :py:class:`Uranium.UM.PluginRegistry`
         :py:class:`Uranium.UM.PluginRegistry`
         """
         """
 
 
@@ -759,7 +759,7 @@ class CuraApplication(QtApplication):
 
 
     def _setLoadingHint(self, hint: str):
     def _setLoadingHint(self, hint: str):
         """Set a short, user-friendly hint about current loading status.
         """Set a short, user-friendly hint about current loading status.
-        
+
         The way this message is displayed depends on application state
         The way this message is displayed depends on application state
         """
         """
 
 
@@ -1010,7 +1010,7 @@ class CuraApplication(QtApplication):
 
 
     def getMachineActionManager(self, *args: Any) -> MachineActionManager.MachineActionManager:
     def getMachineActionManager(self, *args: Any) -> MachineActionManager.MachineActionManager:
         """Get the machine action manager
         """Get the machine action manager
-        
+
         We ignore any *args given to this, as we also register the machine manager as qml singleton.
         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.
         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):
     def registerObjects(self, engine):
         """Registers objects for the QML engine to use.
         """Registers objects for the QML engine to use.
-        
+
         :param engine: The QML engine.
         :param engine: The QML engine.
         """
         """
 
 
@@ -1391,7 +1391,7 @@ class CuraApplication(QtApplication):
 
 
     def arrange(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode]) -> None:
     def arrange(self, nodes: List[SceneNode], fixed_nodes: List[SceneNode]) -> None:
         """Arrange a set of nodes given a set of fixed nodes
         """Arrange a set of nodes given a set of fixed nodes
-        
+
         :param nodes: nodes that we have to place
         :param nodes: nodes that we have to place
         :param fixed_nodes: nodes that are placed in the arranger before finding spots for nodes
         :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")
     @pyqtSlot(str, "QVariant")
     def addAdditionalComponent(self, area_id: str, component):
     def addAdditionalComponent(self, area_id: str, component):
         """Add a component to a list of components to be reparented to another area in the GUI.
         """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.
         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 area_id: dentifying name of the area to which the component should be reparented
         :param (QQuickComponent) component: The component that should be reparented
         :param (QQuickComponent) component: The component that should be reparented
@@ -1707,7 +1707,7 @@ class CuraApplication(QtApplication):
     @pyqtSlot(QUrl)
     @pyqtSlot(QUrl)
     def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None):
     def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None):
         """Open a local file
         """Open a local file
-        
+
         :param project_mode: How to handle project files. Either None(default): Follow user preference, "open_as_model"
         :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.
          or "open_as_project". This parameter is only considered if the file is a project file.
         """
         """

Some files were not shown because too many files changed in this diff