dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/37642?usp=email )

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: filesystem: add export method for ADF files
......................................................................

filesystem: add export method for ADF files

This patch adds an export method to CardADF, which calls the application
specific export method in CardApplication class

Related: OS#6092
Change-Id: I8129656096ecaf41b36e5f2afbbfbebcd0587886
---
M pySim/filesystem.py
1 file changed, 18 insertions(+), 0 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index a4659cf..e3efcab 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -541,6 +541,15 @@
         else:
             return self.aid

+    @staticmethod
+    def export(as_json: bool, lchan):
+        """
+        Export application specific parameters that are not part of the UICC 
filesystem.
+        """
+        if not isinstance(lchan.selected_file, CardADF):
+            raise TypeError('currently selected file is not of type CardADF')
+        return lchan.selected_file.application.export(as_json, lchan)
+

 class CardEF(CardFile):
     """EF (Entry File) in the smart card filesystem"""
@@ -1428,6 +1437,15 @@
         """
         return interpret_sw(self.sw, sw)

+    @staticmethod
+    def export(as_json: bool, lchan):
+        """
+        Export application specific parameters, in the form of commandline 
script. (see also comment in the export
+        method of class "CardFile")
+        """
+        return "# %s has no exportable features" % str(lchan.selected_file)
+
+

 class CardModel(abc.ABC):
     """A specific card model, typically having some additional vendor-specific 
files. All

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37642?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8129656096ecaf41b36e5f2afbbfbebcd0587886
Gerrit-Change-Number: 37642
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>

Reply via email to