Add type hints to auto_repairs and auto_setup
This commit is contained in:
parent
386a8b7000
commit
a253fdc80f
2 changed files with 20 additions and 6 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue