pySim-shell: allow card insertion at runtime

Currently a card must be present in the reader until the user can enter
pySim-shell. Removing and plugging another card is in theory already
possible, but then the new card will operate on the old card and runtime
state object. It might also be useful to enter pySim-shell before the
card is plugged to execute some other commands for preperation before.

So lets allow to "equip" pySim-shell with a card and rs object at
runtime.

Related: SYS#5617
Change-Id: I9cf532d9da8203065463c7201e7064de6c7ab1b5
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index fe781de..cc9176f 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -1329,6 +1329,11 @@
             raise TypeError("Only works with BER-TLV EF")
         return self.card._scc.set_data(self.selected_file.fid, tag, data_hex, conserve=self.conserve_write)
 
+    def unregister_cmds(self, cmd_app=None):
+        """Unregister all file specific commands."""
+        if cmd_app and self.selected_file.shell_commands:
+            for c in self.selected_file.shell_commands:
+                cmd_app.unregister_command_set(c)