mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 06:18:33 +03:00
pySim-shell: Use iteration when unregistering command sets
This makes it more easy to extend in the future Change-Id: I53ecf03d330fe1eb80ee920e6f9c8185f9be48fd
This commit is contained in:
@@ -138,12 +138,10 @@ class PysimApp(cmd2.Cmd):
|
|||||||
# Unequip everything from pySim-shell that would not work in unequipped state
|
# Unequip everything from pySim-shell that would not work in unequipped state
|
||||||
if self.rs:
|
if self.rs:
|
||||||
self.rs.unregister_cmds(self)
|
self.rs.unregister_cmds(self)
|
||||||
cmd_set = self.find_commandsets(Iso7816Commands)
|
for cmds in [Iso7816Commands, PySimCommands]:
|
||||||
if cmd_set:
|
cmd_set = self.find_commandsets(cmds)
|
||||||
self.unregister_command_set(cmd_set[0])
|
if cmd_set:
|
||||||
cmd_set = self.find_commandsets(PySimCommands)
|
self.unregister_command_set(cmd_set[0])
|
||||||
if cmd_set:
|
|
||||||
self.unregister_command_set(cmd_set[0])
|
|
||||||
|
|
||||||
self.card = card
|
self.card = card
|
||||||
self.rs = rs
|
self.rs = rs
|
||||||
|
|||||||
Reference in New Issue
Block a user