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:
authordigitalfrost <gerald.hofmaier@gmail.com>2022-07-31 12:46:03 +0300
committerdigitalfrost <gerald.hofmaier@gmail.com>2022-07-31 12:46:03 +0300
commitcfeab2e6c0a51b9b6490927cb6a801ac0a7271c6 (patch)
tree00e2489fa9daf4a41003530ee3312e8c4fdd38ee /cura/PrinterOutput
parent9bb3b1a3753f41f5a3da2cf8ad9b1350259ddfd6 (diff)
Use dataclasses for Peripheral
Since Peripheral is a data class use dataclasses
Diffstat (limited to 'cura/PrinterOutput')
-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