diff options
author | Jelle Spijker <j.spijker@ultimaker.com> | 2022-08-23 11:23:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 11:23:47 +0300 |
commit | cc9a413a49cfc93a6b1105faa4d8ef087816aabb (patch) | |
tree | da80de50ee0298c7c376f54bfdbf624116b6c32f | |
parent | 67c8585c681eb475a094ad5f411d38da3a70ac1f (diff) | |
parent | cfeab2e6c0a51b9b6490927cb6a801ac0a7271c6 (diff) |
Merge pull request #12909 from digitalfrost/310722
Use dataclasses for Peripheral
-rw-r--r-- | cura/PrinterOutput/Peripheral.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/cura/PrinterOutput/Peripheral.py b/cura/PrinterOutput/Peripheral.py index 27d127832b..4613506978 100644 --- a/cura/PrinterOutput/Peripheral.py +++ b/cura/PrinterOutput/Peripheral.py @@ -1,20 +1,19 @@ # Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from dataclasses import dataclass +@dataclass 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. - """ - - 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. - """ - self.type = peripheral_type - self.name = name + Args: + type (string): A unique ID for the type of peripheral. + name (string): A human-readable name for the peripheral. + """ + type: str + name: str |