First working version

This commit is contained in:
Michael Hansen
2024-01-14 22:19:01 -06:00
parent 316427948e
commit 8063f5b773
12 changed files with 740 additions and 439 deletions
+11 -7
View File
@@ -1,13 +1,13 @@
"""Python interface to whiptail command."""
import subprocess
import time
import logging
import shlex
from concurrent.futures import ThreadPoolExecutor
import subprocess
import time
from collections.abc import Sequence
from typing import Any, Dict, List, Tuple, Optional, Union
from concurrent.futures import ThreadPoolExecutor
from typing import Any, Dict, List, Optional, Tuple, Union
from .const import TITLE, WIDTH, HEIGHT, LIST_HEIGHT
from .const import HEIGHT, LIST_HEIGHT, TITLE, WIDTH
ItemType = Union[str, Tuple[Any, str]]
@@ -66,7 +66,9 @@ def menu(
def inputbox(text: str, init: Optional[Any] = None) -> Optional[str]:
return whiptail("--inputbox", text, HEIGHT, WIDTH, str(init) or "")
return whiptail(
"--inputbox", text, HEIGHT, WIDTH, str(init) if init is not None else ""
)
def passwordbox(text: str) -> Optional[str]:
@@ -184,7 +186,9 @@ def gauge(text: str, seconds: int, parts: int = 20) -> None:
def error(reason: str) -> None:
msgbox(f"An error occurred while {reason}.\n" "See local/installer.log for details.")
msgbox(
f"An error occurred while {reason}.\n" "See local/installer.log for details."
)
# -----------------------------------------------------------------------------