- Issue: Components still use
from rcp.app import MainAppinside__init__methods to avoid circular imports. This is a known/accepted pattern documented in CLAUDE.md. - Action: Consider dependency injection instead of
get_running_app()as the codebase evolves.
- File:
rcp/utils/communication.py - Issue:
read_float,write_float,read_long,write_long,read_unsigned,write_unsigned,read_signed,write_signedare all module-level functions that takeConnectionManageras the first argument. They duplicate the same try/except/connected pattern. - Action: Refactor as methods on
ConnectionManager, and extract the shared try/except pattern into a decorator or helper.
- File:
rcp/utils/base_device.py - Issue:
register_type()(classmethod) andparse_addresses_from_definition()(instance method) contain nearly identical C struct parsing logic. - Action: Extract shared parsing into a single function that both methods call.
rcp/app.py:56-59-beep()method is a no-op with commented-out implementationrcp/components/toolbars/toolbar_button.py:12-22- class body ispassfollowed by commented-out codercp/components/screens/color_picker_screen.py:15-19- commented-out__init__rcp/components/home/home_toolbar.py:20-21- commented-outpopup_scenercp/components/screens/home_screen.py-TraceOutputopens file butself.exit_stackis never initialized (would raiseAttributeErrorat runtime)- Action: Remove dead code. Either restore
beep()or remove it entirely. Fix or remove theTraceOutputcode path.