Update ui.py

Signed-off-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
This commit is contained in:
Mithun Gowda B
2025-07-16 11:11:13 +05:30
committed by GitHub
parent b930968c18
commit 1af243bffa

View File

@@ -6,7 +6,7 @@ Cross-platform console UI with colors and progress indication
import sys import sys
import time import time
import shutil import shutil
from typing import List, Optional, Any, Dict from typing import List, Optional, Any, Dict, Union
from enum import Enum from enum import Enum
# Try to import colorama for cross-platform color support # Try to import colorama for cross-platform color support
@@ -167,7 +167,7 @@ class Menu:
self.multi_select = multi_select self.multi_select = multi_select
self.selected = set() if multi_select else None self.selected = set() if multi_select else None
def display(self) -> int | List[int]: def display(self) -> Union[int, List[int]]:
""" """
Display menu and get user selection Display menu and get user selection
@@ -431,4 +431,4 @@ def truncate_text(text: str, max_length: int, suffix: str = "...") -> str:
if len(text) <= max_length: if len(text) <= max_length:
return text return text
return text[:max_length - len(suffix)] + suffix return text[:max_length - len(suffix)] + suffix