mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Use dataclasses for Peripheral
Since Peripheral is a data class use dataclasses
This commit is contained in:
parent
9bb3b1a375
commit
cfeab2e6c0
1 changed files with 8 additions and 9 deletions
|
@ -1,20 +1,19 @@
|
||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
@dataclass
|
||||||
class Peripheral:
|
class Peripheral:
|
||||||
"""Data class that represents a peripheral for a printer.
|
"""Data class that represents a peripheral for a printer.
|
||||||
|
|
||||||
Output device plug-ins may specify that the printer has a certain set of
|
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
|
peripherals. This set is then possibly shown in the interface of the monitor
|
||||||
stage.
|
stage.
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, peripheral_type: str, name: str) -> None:
|
Args:
|
||||||
"""Constructs the peripheral.
|
type (string): A unique ID for the type of peripheral.
|
||||||
|
name (string): A human-readable name for 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
|
type: str
|
||||||
self.name = name
|
name: str
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue