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

View file

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