From 9aa09c436e20e1d2ed848934addd74d5b5cc9e3d Mon Sep 17 00:00:00 2001 From: yeongpin Date: Thu, 10 Apr 2025 00:28:20 +0800 Subject: [PATCH] Enhance cursor path retrieval in reset_machine_manual.py for Linux systems - Updated the get_workbench_cursor_path function to handle Linux systems more effectively. - Added logic to use the first base path if no valid paths are found in the existing loop. - Improved maintainability and clarity of the code by explicitly handling different operating systems. --- reset_machine_manual.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reset_machine_manual.py b/reset_machine_manual.py index f4cb01b..4c34b68 100644 --- a/reset_machine_manual.py +++ b/reset_machine_manual.py @@ -221,8 +221,12 @@ def get_workbench_cursor_path(translator=None) -> str: if system == "Windows": base_path = config.get('WindowsPaths', 'cursor_path') - else: + elif system == "Darwin": base_path = paths_map[system]["base"] + else: # Linux + # For Linux, we've already checked all bases in the loop above + # If we're here, it means none of the bases worked, so we'll use the first one + base_path = paths_map[system]["bases"][0] main_path = os.path.join(base_path, paths_map[system]["main"])