Просмотр исходного кода

Convert remaining doxygen to rst

Nino van Hooff 4 лет назад
Родитель
Сommit
c2c96faf5f

+ 13 - 9
cmake/mod_bundled_packages_json.py

@@ -11,11 +11,13 @@ import os
 import sys
 
 
-## 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.
 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.
+    """
+
     json_file_list = []
     for root, dir_names, file_names in os.walk(work_dir):
         for file_name in file_names:
@@ -24,12 +26,14 @@ def find_json_files(work_dir: str) -> list:
     return json_file_list
 
 
-## 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
 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
+    """
+
     try:
         with open(file_path, "r", encoding = "utf-8") as f:
             package_dict = json.load(f, object_hook = collections.OrderedDict)

+ 2 - 1
cura/Operations/PlatformPhysicsOperation.py

@@ -6,8 +6,9 @@ from UM.Operations.GroupedOperation import GroupedOperation
 from UM.Scene.SceneNode import SceneNode
 
 
-##  A specialised operation designed specifically to modify the previous operation.
 class PlatformPhysicsOperation(Operation):
+    """A specialised operation designed specifically to modify the previous operation."""
+
     def __init__(self, node: SceneNode, translation: Vector) -> None:
         super().__init__()
         self._node = node

+ 2 - 1
cura/Operations/SetBuildPlateNumberOperation.py

@@ -7,8 +7,9 @@ from UM.Operations.Operation import Operation
 from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
 
 
-##  Simple operation to set the buildplate number of a scenenode.
 class SetBuildPlateNumberOperation(Operation):
+    """Simple operation to set the buildplate number of a scenenode."""
+
     def __init__(self, node: SceneNode, build_plate_nr: int) -> None:
         super().__init__()
         self._node = node

+ 22 - 14
cura/Operations/SetParentOperation.py

@@ -6,31 +6,37 @@ from UM.Scene.SceneNode import SceneNode
 from UM.Operations import Operation
 
 
-
-##  An operation that parents a scene node to another scene node.
 class SetParentOperation(Operation.Operation):
-    ##  Initialises this SetParentOperation.
-    #
-    #   \param node The node which will be reparented.
-    #   \param parent_node The node which will be the parent.
+    """An operation that parents a scene node to another scene node."""
+
     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.
+        """
+
         super().__init__()
         self._node = node
         self._parent = parent_node
         self._old_parent = node.getParent() # To restore the previous parent in case of an undo.
 
-    ##  Undoes the set-parent operation, restoring the old parent.
     def undo(self) -> None:
+        """Undoes the set-parent operation, restoring the old parent."""
+
         self._set_parent(self._old_parent)
 
-    ##  Re-applies the set-parent operation.
     def redo(self) -> None:
+        """Re-applies the set-parent operation."""
+
         self._set_parent(self._parent)
 
-    ##  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.
     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.
+        """
+
         if new_parent:
             current_parent = self._node.getParent()
             if current_parent:
@@ -56,8 +62,10 @@ class SetParentOperation(Operation.Operation):
 
         self._node.setParent(new_parent)
 
-    ##  Returns a programmer-readable representation of this operation.
-    #
-    #   \return A programmer-readable representation of this operation.
     def __repr__(self) -> str:
+        """Returns a programmer-readable representation of this operation.
+        
+        :return: A programmer-readable representation of this operation.
+        """
+
         return "SetParentOperation(node = {0}, parent_node={1})".format(self._node, self._parent)

+ 2 - 1
cura/PrinterOutput/FirmwareUpdater.py

@@ -44,8 +44,9 @@ class FirmwareUpdater(QObject):
     def _updateFirmware(self) -> None:
         raise NotImplementedError("_updateFirmware needs to be implemented")
 
-    ##  Cleanup after a succesful update
     def _cleanupAfterUpdate(self) -> None:
+        """Cleanup after a succesful update"""
+
         # Clean up for next attempt.
         self._update_firmware_thread = Thread(target=self._updateFirmware, daemon=True, name = "FirmwareUpdateThread")
         self._firmware_file = ""

+ 6 - 3
cura/PrinterOutput/Models/ExtruderConfigurationModel.py

@@ -47,10 +47,13 @@ class ExtruderConfigurationModel(QObject):
     def hotendID(self) -> Optional[str]:
         return self._hotend_id
 
-    ##  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.
     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.
+        """
+
         return True
 
     def __str__(self) -> str:

+ 11 - 7
cura/PrinterOutput/Models/ExtruderOutputModel.py

@@ -54,8 +54,9 @@ class ExtruderOutputModel(QObject):
     def updateActiveMaterial(self, material: Optional["MaterialOutputModel"]) -> None:
         self._extruder_configuration.setMaterial(material)
 
-    ##  Update the hotend temperature. This only changes it locally.
     def updateHotendTemperature(self, temperature: float) -> None:
+        """Update the hotend temperature. This only changes it locally."""
+
         if self._hotend_temperature != temperature:
             self._hotend_temperature = temperature
             self.hotendTemperatureChanged.emit()
@@ -65,9 +66,10 @@ class ExtruderOutputModel(QObject):
             self._target_hotend_temperature = temperature
             self.targetHotendTemperatureChanged.emit()
 
-    ##  Set the target hotend temperature. This ensures that it's actually sent to the remote.
     @pyqtSlot(float)
     def setTargetHotendTemperature(self, temperature: float) -> None:
+        """Set the target hotend temperature. This ensures that it's actually sent to the remote."""
+
         self._printer.getController().setTargetHotendTemperature(self._printer, self, temperature)
         self.updateTargetHotendTemperature(temperature)
 
@@ -101,13 +103,15 @@ class ExtruderOutputModel(QObject):
     def isPreheating(self) -> bool:
         return self._is_preheating
 
-    ##  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.
     @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.
+        """
+
         self._printer._controller.preheatHotend(self, temperature, duration)
 
     @pyqtSlot()

+ 8 - 4
cura/PrinterOutput/Models/PrinterConfigurationModel.py

@@ -48,9 +48,11 @@ class PrinterConfigurationModel(QObject):
     def buildplateConfiguration(self) -> str:
         return self._buildplate_configuration
 
-    ##  This method is intended to indicate whether the configuration is valid or not.
-    #   The method checks if the mandatory fields are or not set
     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:
             return False
         for configuration in self._extruder_configurations:
@@ -97,9 +99,11 @@ class PrinterConfigurationModel(QObject):
 
         return True
 
-    ##  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.
     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)
         first_extruder = None
         for configuration in self._extruder_configurations:

+ 11 - 7
cura/PrinterOutput/Models/PrinterOutputModel.py

@@ -163,13 +163,15 @@ class PrinterOutputModel(QObject):
     def moveHead(self, x: float = 0, y: float = 0, z: float = 0, speed: float = 3000) -> None:
         self._controller.moveHead(self, x, y, z, speed)
 
-    ##  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.
     @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.
+        """
+
         self._controller.preheatBed(self, temperature, duration)
 
     @pyqtSlot()
@@ -200,8 +202,9 @@ class PrinterOutputModel(QObject):
             self._unique_name = unique_name
             self.nameChanged.emit()
 
-    ##  Update the bed temperature. This only changes it locally.
     def updateBedTemperature(self, temperature: float) -> None:
+        """Update the bed temperature. This only changes it locally."""
+
         if self._bed_temperature != temperature:
             self._bed_temperature = temperature
             self.bedTemperatureChanged.emit()
@@ -211,9 +214,10 @@ class PrinterOutputModel(QObject):
             self._target_bed_temperature = temperature
             self.targetBedTemperatureChanged.emit()
 
-    ##  Set the target bed temperature. This ensures that it's actually sent to the remote.
     @pyqtSlot(float)
     def setTargetBedTemperature(self, temperature: float) -> None:
+        """Set the target bed temperature. This ensures that it's actually sent to the remote."""
+
         self._controller.setTargetBedTemperature(self, temperature)
         self.updateTargetBedTemperature(temperature)
 

+ 2 - 1
cura/PrinterOutput/NetworkMJPGImage.py

@@ -32,8 +32,9 @@ class NetworkMJPGImage(QQuickPaintedItem):
 
         self.setAntialiasing(True)
 
-    ##  Ensure that close gets called when object is destroyed
     def __del__(self) -> None:
+        """Ensure that close gets called when object is destroyed"""
+
         self.stop()
 
 

Некоторые файлы не были показаны из-за большого количества измененных файлов