Remove trailing whitespace from Python files

This commit is contained in:
Nino van Hooff 2020-05-29 14:30:33 +02:00
parent 1e33360c35
commit 89f0970a88
157 changed files with 562 additions and 562 deletions

View file

@ -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.
"""

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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)

View file

@ -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.

View file

@ -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

View file

@ -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.
"""

View file

@ -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

View file

@ -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'
"""

View file

@ -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

View file

@ -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.
"""

View file

@ -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.

View file

@ -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.

View file

@ -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).

View file

@ -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.
"""