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.
This commit is contained in:
yeongpin 2025-04-10 00:28:20 +08:00
parent 1e3e9c99eb
commit 9aa09c436e

View File

@ -221,8 +221,12 @@ def get_workbench_cursor_path(translator=None) -> str:
if system == "Windows": if system == "Windows":
base_path = config.get('WindowsPaths', 'cursor_path') base_path = config.get('WindowsPaths', 'cursor_path')
else: elif system == "Darwin":
base_path = paths_map[system]["base"] 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"]) main_path = os.path.join(base_path, paths_map[system]["main"])