From c4480895a1744e9c13b19dc0309fc50fd4c92e6f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 21 Jun 2025 00:41:33 +0100 Subject: [PATCH] add empty_if_false to check_mark patch bump --- obsws_cli/__about__.py | 2 +- obsws_cli/profile.py | 2 +- obsws_cli/scene.py | 4 ++-- obsws_cli/util.py | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/obsws_cli/__about__.py b/obsws_cli/__about__.py index 9013f9f..e64c45c 100644 --- a/obsws_cli/__about__.py +++ b/obsws_cli/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2025-present onyx-and-iris # # SPDX-License-Identifier: MIT -__version__ = "0.17.3" +__version__ = "0.17.4" diff --git a/obsws_cli/profile.py b/obsws_cli/profile.py index d60e2dd..cd11acf 100644 --- a/obsws_cli/profile.py +++ b/obsws_cli/profile.py @@ -32,7 +32,7 @@ def list_(ctx: typer.Context): for profile in resp.profiles: table.add_row( profile, - util.check_mark(profile == resp.current_profile_name), + util.check_mark(profile == resp.current_profile_name, empty_if_false=True), ) console.out.print(table) diff --git a/obsws_cli/scene.py b/obsws_cli/scene.py index 92d217a..ab5cb2b 100644 --- a/obsws_cli/scene.py +++ b/obsws_cli/scene.py @@ -55,13 +55,13 @@ def list_( if uuid: table.add_row( scene_output, - util.check_mark(scene_name == active_scene), + util.check_mark(scene_name == active_scene, empty_if_false=True), scene_uuid, ) else: table.add_row( scene_output, - util.check_mark(scene_name == active_scene), + util.check_mark(scene_name == active_scene, empty_if_false=True), ) console.out.print(table) diff --git a/obsws_cli/util.py b/obsws_cli/util.py index abb4e94..98f1299 100644 --- a/obsws_cli/util.py +++ b/obsws_cli/util.py @@ -8,8 +8,11 @@ def snakecase_to_titlecase(snake_str: str) -> str: return snake_str.replace('_', ' ').title() -def check_mark(value: bool) -> str: +def check_mark(value: bool, empty_if_false: bool = False) -> str: """Return a check mark or cross mark based on the boolean value.""" + if empty_if_false and not value: + return '' + if os.getenv('NO_COLOR') is not None: return '✓' if value else '✗' return '✅' if value else '❌'