From a253fdc80f3e5904b9b061aa8a6e5bf5c36c413f Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 29 May 2023 17:09:32 -0700 Subject: [PATCH] Add type hints to auto_repairs and auto_setup --- scripts/auto_repairs.py | 13 ++++++++++--- scripts/auto_setup.py | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/auto_repairs.py b/scripts/auto_repairs.py index aa0b4d29..61af1c8f 100644 --- a/scripts/auto_repairs.py +++ b/scripts/auto_repairs.py @@ -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, diff --git a/scripts/auto_setup.py b/scripts/auto_setup.py index f76ee648..839ab1e5 100644 --- a/scripts/auto_setup.py +++ b/scripts/auto_setup.py @@ -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,