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:
authorJelle Spijker <j.spijker@ultimaker.com>2022-08-23 11:23:47 +0300
committerGitHub <noreply@github.com>2022-08-23 11:23:47 +0300
commitcc9a413a49cfc93a6b1105faa4d8ef087816aabb (patch)
treeda80de50ee0298c7c376f54bfdbf624116b6c32f
parent67c8585c681eb475a094ad5f411d38da3a70ac1f (diff)
parentcfeab2e6c0a51b9b6490927cb6a801ac0a7271c6 (diff)
Merge pull request #12909 from digitalfrost/310722
Use dataclasses for Peripheral
-rw-r--r--cura/PrinterOutput/Peripheral.py17
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