Of course. Here is a draft for a GitHub issue description based on the problem we solved.
Title: App crashes on non-Linux systems due to missing nmcli
Description
The application crashes on startup when run on operating systems other than Linux, such as macOS. This is because it tries to use the nmcli command-line tool, which is not available on these platforms.
Error Log
Traceback (most recent call last):
File "/Users/gregkopp/Projects/rotary-controller-python/./rcp/main.py", line 23, in <module>
asyncio.run(MainApp().async_run())
...
File "/Users/gregkopp/Projects/rotary-controller-python/rcp/components/setup/network_screen.py", line 46, in __init__
self.wifi_enabled = nmcli.radio().wifi
...
FileNotFoundError: [Errno 2] No such file or directory: 'nmcli'
Cause
The network_screen.py file directly calls nmcli functions to manage network state. If nmcli is not in the system's PATH, a FileNotFoundError is raised, which is unhandled and causes the application to terminate.
Proposed Fix
The fix is to make the application resilient to the absence of nmcli. This can be achieved by:
- Wrapping
nmcli calls in try...except FileNotFoundError blocks.
- In the
except block, log a warning message indicating that nmcli was not found and that network features will be disabled.
- Use a flag (e.g.,
self.wifi_enabled) to track the availability of nmcli.
- Conditionally disable UI elements and functionality that depend on
nmcli based on this flag.
This ensures the application remains functional on non-Linux systems, with network management features gracefully disabled.
Of course. Here is a draft for a GitHub issue description based on the problem we solved.
Title: App crashes on non-Linux systems due to missing
nmcliDescription
The application crashes on startup when run on operating systems other than Linux, such as macOS. This is because it tries to use the
nmclicommand-line tool, which is not available on these platforms.Error Log
Cause
The network_screen.py file directly calls
nmclifunctions to manage network state. Ifnmcliis not in the system's PATH, aFileNotFoundErroris raised, which is unhandled and causes the application to terminate.Proposed Fix
The fix is to make the application resilient to the absence of
nmcli. This can be achieved by:nmclicalls intry...except FileNotFoundErrorblocks.exceptblock, log a warning message indicating thatnmcliwas not found and that network features will be disabled.self.wifi_enabled) to track the availability ofnmcli.nmclibased on this flag.This ensures the application remains functional on non-Linux systems, with network management features gracefully disabled.