Add type hints to auto_repairs and auto_setup

This commit is contained in:
2Shirt 2023-05-29 17:09:32 -07:00
parent 386a8b7000
commit a253fdc80f
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 20 additions and 6 deletions

View file

@ -1,6 +1,8 @@
"""WizardKit: Auto Repair Tool""" """WizardKit: Auto Repair Tool"""
# vim: sts=2 sw=2 ts=2 # vim: sts=2 sw=2 ts=2
from typing import Any
import wk import wk
@ -8,9 +10,14 @@ import wk
REBOOT_STR = wk.ui.ansi.color_string('Reboot', 'YELLOW') REBOOT_STR = wk.ui.ansi.color_string('Reboot', 'YELLOW')
class MenuEntry(): class MenuEntry():
"""Simple class to allow cleaner code below.""" """Simple class to allow cleaner code below."""
def __init__(self, name, function=None, selected=True, **kwargs): def __init__(
self.name = name self,
self.details = { name: str,
function: str | None = None,
selected: bool = True,
**kwargs):
self.name: str = name
self.details: dict[str, Any] = {
'Function': function, 'Function': function,
'Selected': selected, 'Selected': selected,
**kwargs, **kwargs,

View file

@ -1,15 +1,22 @@
"""WizardKit: Auto System Setup Tool""" """WizardKit: Auto System Setup Tool"""
# vim: sts=2 sw=2 ts=2 # vim: sts=2 sw=2 ts=2
from typing import Any
import wk import wk
# Classes # Classes
class MenuEntry(): class MenuEntry():
"""Simple class to allow cleaner code below.""" """Simple class to allow cleaner code below."""
def __init__(self, name, function=None, selected=True, **kwargs): def __init__(
self.name = name self,
self.details = { name: str,
function: str | None = None,
selected: bool = True,
**kwargs):
self.name: str = name
self.details: dict[str, Any] = {
'Function': function, 'Function': function,
'Selected': selected, 'Selected': selected,
**kwargs, **kwargs,