Skip to content

Commit

Permalink
Use dataclass instead of manual constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Oct 21, 2024
1 parent 6a0b7df commit 12c84e1
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/nitrokey/trussed/admin_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,14 @@ def __str__(self) -> str:
return "u8"


@dataclass
class ConfigField:
name: str
requires_touch_confirmation: bool
requires_reboot: bool
destructive: bool
ty: ConfigFieldType

def __init__(
self,
name: str,
requires_touch_confirmation: bool,
requires_reboot: bool,
destructive: bool,
ty: ConfigFieldType,
):
self.name = name
self.requires_touch_confirmation = requires_touch_confirmation
self.requires_reboot = requires_reboot
self.destructive = destructive
self.ty = ty


class AdminApp:
def __init__(self, device: TrussedDevice) -> None:
Expand Down

0 comments on commit 12c84e1

Please sign in to comment.