laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/28627 )
Change subject: fileystem: Use human-readable ADF name if available.
......................................................................
fileystem: Use human-readable ADF name if available.
When using __str__ for a CardDF we would get "DF(DF.TELECOM)"
but when using it on CardADF we would get ADF(a0000000871002)"
instead of "ADF(ADF.USIM)". Let's fix that.
Change-Id: I5801a08bcc28cb222734af6d9ee835227f4fee69
---
M pySim/filesystem.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 813bebb..a3e83d6 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -488,7 +488,7 @@
mf.add_application_df(self)
def __str__(self):
- return "ADF(%s)" % (self.aid)
+ return "ADF(%s)" % (self.name if self.name else self.aid)
def _path_element(self, prefer_name: bool):
if self.name and prefer_name:
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28627
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5801a08bcc28cb222734af6d9ee835227f4fee69
Gerrit-Change-Number: 28627
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/28623 )
Change subject: filesystem: raise exception only when applicable
......................................................................
filesystem: raise exception only when applicable
We should first see if any of the files in the tree actually
require a service mapping before raising
ValueError('TODO: implement recursive service -> file mapping')
Change-Id: I9c339f0cac020e7eec7f4f840748040e5f77923d
---
M pySim/filesystem.py
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 37c668d..c40eaf8 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -301,6 +301,14 @@
else:
raise ValueError
+ def _has_service(self):
+ if self.service:
+ return True
+ for c in self.children.values():
+ if isinstance(c, CardDF):
+ if c._has_service():
+ return True
+
def add_file(self, child: CardFile, ignore_existing: bool = False):
"""Add a child (DF/EF) to this DF.
Args:
@@ -336,7 +344,10 @@
for c in child.children.values():
self._add_file_services(c)
if isinstance(c, CardDF):
- raise ValueError('TODO: implement recursive service -> file mapping')
+ for gc in c.children.values():
+ if isinstance(gc, CardDF):
+ if gc._has_service():
+ raise ValueError('TODO: implement recursive service -> file mapping')
def add_files(self, children: Iterable[CardFile], ignore_existing: bool = False):
"""Add a list of child (DF/EF) to this DF
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28623
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I9c339f0cac020e7eec7f4f840748040e5f77923d
Gerrit-Change-Number: 28623
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged