gdctl: Display booleans as yes / no

Slightly more human readible and less programmer speak.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
This commit is contained in:
Jonas Ådahl 2024-12-19 21:41:14 +01:00 committed by Marge Bot
parent 481f046cd5
commit e326aed70e

View File

@ -120,6 +120,8 @@ def print_properties(*, level, lines, properties):
if isinstance(value, list):
elements_string = ", ".join([str(element) for element in value])
value_string = f"[{elements_string}]"
elif isinstance(value, bool):
value_string = "yes" if value else "no"
else:
value_string = str(value)