<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/25818">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ts_31_10x: add a class for CardApplicationXSIM<br><br>In change Id410489841bb9020ddbf74de9114d808b1d5adb6, the RuntimeState<br>class automatically adds additional files to the CardApplications for<br>ISIM and USIM. This works only once. The second time an exception will<br>be thrown because the added files are already in the CardApplication.<br>Currently there is no way generate new card applications during<br>initialization because the card applications are just objects that are<br>created once in ts_31_10x.py. Lets turn them into classes and create the<br>objects during initialization. This way we get fresh objects when we<br>re-initialize.<br><br>Change-Id: Ibb4f6242e7a92af84a905daa727b1b87016e7819<br>---<br>M pySim-shell.py<br>M pySim/ts_31_102.py<br>M pySim/ts_31_103.py<br>3 files changed, 8 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/18/25818/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim-shell.py b/pySim-shell.py</span><br><span>index d24a881..594ad97 100755</span><br><span>--- a/pySim-shell.py</span><br><span>+++ b/pySim-shell.py</span><br><span>@@ -82,8 +82,8 @@</span><br><span> </span><br><span>         # Create runtime state with card profile</span><br><span>     profile = CardProfileUICC()</span><br><span style="color: hsl(0, 100%, 40%);">-     profile.add_application(CardApplicationUSIM)</span><br><span style="color: hsl(0, 100%, 40%);">-    profile.add_application(CardApplicationISIM)</span><br><span style="color: hsl(120, 100%, 40%);">+  profile.add_application(CardApplicationUSIM())</span><br><span style="color: hsl(120, 100%, 40%);">+        profile.add_application(CardApplicationISIM())</span><br><span>       rs = RuntimeState(card, profile)</span><br><span> </span><br><span>         # FIXME: do this dynamically</span><br><span>diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py</span><br><span>index faf0f38..14d7ec1 100644</span><br><span>--- a/pySim/ts_31_102.py</span><br><span>+++ b/pySim/ts_31_102.py</span><br><span>@@ -1115,4 +1115,6 @@</span><br><span>     }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-CardApplicationUSIM = CardApplication('USIM', adf=ADF_USIM(), sw=sw_usim)</span><br><span style="color: hsl(120, 100%, 40%);">+class CardApplicationUSIM(CardApplication):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        super().__init__('USIM', adf=ADF_USIM(), sw=sw_usim)</span><br><span>diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py</span><br><span>index e1f552f..63ef99e 100644</span><br><span>--- a/pySim/ts_31_103.py</span><br><span>+++ b/pySim/ts_31_103.py</span><br><span>@@ -223,4 +223,6 @@</span><br><span>     }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-CardApplicationISIM = CardApplication('ISIM', adf=ADF_ISIM(), sw=sw_isim)</span><br><span style="color: hsl(120, 100%, 40%);">+class CardApplicationISIM(CardApplication):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self):</span><br><span style="color: hsl(120, 100%, 40%);">+      super().__init__('ISIM', adf=ADF_ISIM(), sw=sw_isim)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/25818">change 25818</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/25818"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibb4f6242e7a92af84a905daa727b1b87016e7819 </div>
<div style="display:none"> Gerrit-Change-Number: 25818 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>