Skip to content

Commit 2cc88cb

Browse files
Check for Empty Config
1 parent d7d912b commit 2cc88cb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

archinstall/tui/components.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ def _translate_bindings(source: BindingsMap | None, target: BindingsMap) -> None
5555
target.key_to_bindings[key] = [replace(b, description=tr(b.description)) if b.description else b for b in bindings]
5656

5757

58+
def _val_is_empty(val: Any) -> bool:
59+
if val is None:
60+
return True
61+
if isinstance(val, (list, dict, set, tuple, str)) and len(val) == 0:
62+
return True
63+
if hasattr(val, '__dict__') and all(_val_is_empty(v) for v in vars(val).values()):
64+
return True
65+
return False
66+
67+
5868
def _get_status_prefix(item: MenuItem) -> str:
5969
"""
6070
Returns a rich-formatted status prefix icon depending on item state:
@@ -67,7 +77,7 @@ def _get_status_prefix(item: MenuItem) -> str:
6777
if item.read_only or is_special_key:
6878
return ''
6979

70-
if item.has_value():
80+
if item.has_value() and not _val_is_empty(item.value):
7181
return ' '
7282
else:
7383
return '[bold yellow]![/bold yellow] '

0 commit comments

Comments
 (0)