From f123de9a52128afd1a9e9dfd0feaa847b57b83ff Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 2 Apr 2026 23:12:28 +0545 Subject: [PATCH] =?UTF-8?q?refactor(utils):simplify=20Wi=E2=80=91Fi=20icon?= =?UTF-8?q?=20path=20resolution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/functions.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/utils/functions.py b/utils/functions.py index 877ca0c..b90eb44 100644 --- a/utils/functions.py +++ b/utils/functions.py @@ -101,13 +101,8 @@ def get_wifi_icon_for_strength(strength: int) -> str: strength: Signal strength from 0-100 Returns: - Absolute path to the appropriate WiFi icon + Relative path to the appropriate WiFi icon """ - # Get the current directory where this script is located - current_dir = os.path.dirname(os.path.abspath(__file__)) - # Get the project root (parent of utils directory) - project_root = os.path.dirname(current_dir) - if strength >= 80: icon_name = "network-wireless-100.svg" elif strength >= 60: @@ -121,7 +116,7 @@ def get_wifi_icon_for_strength(strength: int) -> str: else: icon_name = "network-wireless-0.svg" - return os.path.join(project_root, "assets", "icons", "wifi", icon_name) + return f"wifi/{icon_name}" def get_wifi_connecting_icon() -> str: @@ -129,16 +124,9 @@ def get_wifi_connecting_icon() -> str: Get the WiFi connecting icon path. Returns: - Absolute path to the WiFi connecting icon + Relative path to the WiFi connecting icon """ - # Get the current directory where this script is located - current_dir = os.path.dirname(os.path.abspath(__file__)) - # Get the project root (parent of utils directory) - project_root = os.path.dirname(current_dir) - - return os.path.join( - project_root, "config", "assets", "icons", "wifi", "wifi-connecting.svg" - ) + return "wifi/wifi-connecting.svg" def is_special_workspace_id(ws_id) -> bool: