pySim-shell: clean up method calls in do_switch_channel

The function do_switch_channel method calls methods in RuntimeLchan
that should be private. There is also a code duplication in
RuntimeLchan that should be cleaned up.

Related: OS#6092
Change-Id: Ie5e5f45787abaaf032e1b49f51d447653cf2c996
This commit is contained in:
Philipp Maier
2024-07-25 15:57:13 +02:00
committed by laforge
parent 4fefac78b8
commit dff7bb0687
2 changed files with 15 additions and 14 deletions

View File

@@ -859,9 +859,9 @@ above the to-be-activated EF must be selected!"""
@cmd2.with_argparser(switch_chan_parser)
def do_switch_channel(self, opts):
"""Switch currently active logical channel."""
self._cmd.lchan._select_pre(self._cmd)
self._cmd.lchan.unregister_cmds(self._cmd)
self._cmd.lchan = self._cmd.rs.lchan[opts.chan_nr]
self._cmd.lchan._select_post(self._cmd)
self._cmd.lchan.register_cmds(self._cmd)
self._cmd.update_prompt()
def do_status(self, opts):