aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-07-24 11:35:53 +0200
committerHarald Welte <laforge@osmocom.org>2022-07-24 11:56:35 +0200
commitd2c177b39634e3a45121d1de38751e927bc6441a (patch)
tree896d2bc28b5d595a04dae58c4c07e8d2a34f86e9
parent86d698d310dd62bd63cb0398435bd59b2db28a8e (diff)
filesystem.py: Make CardDF.get_selectables() respect the flags
All other get_selectables() understand a flag like 'FIDS' to request only the hexadecimal FIDs and not the file names. However, the CardEF.get_selectables() ignored those flags and unconditionally returned the names. Change-Id: Icdc37cae3eecd36d167da76c30224b9d48c844fd
-rw-r--r--pySim/filesystem.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 598121b..886a48d 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -541,8 +541,10 @@ class CardEF(CardFile):
"""
# global selectable names + those of the parent DF
sels = super().get_selectables(flags)
- sels.update(
- {x.name: x for x in self.parent.children.values() if x != self})
+ if flags == [] or 'FIDS' in flags:
+ sels.update({x.fid: x for x in self.parent.children.values() if x.fid and x != self})
+ if flags == [] or 'FNAMES' in flags:
+ sels.update({x.name: x for x in self.parent.children.values() if x.name and x != self})
return sels