laforge submitted this change.
Use keyword argument for file description argument
While our base classes (TransparentEF / LinFixedEF) always have the
dsecription as 4th argument after "fid, sfid, name", most of the derived
file-specific classes do not share that same argument order.
As seen in the bug fixed by previous Change-Id I7f32c9fd01094620b68b0e54536ecc6cdbe67903
this can have serious consequences. Let's avoid using unnamed
(positional) arguments for the description text altogether.
Change-Id: Icfb3fd1bae038c54fa14a91aa9f75219d839968c
---
M pySim/ts_31_102.py
M pySim/ts_51_011.py
2 files changed, 73 insertions(+), 57 deletions(-)
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 5afa2ef..54ff4c8 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1382,47 +1382,46 @@
EF_Keys('6f09', 0x09, 'EF.KeysPS',
desc='Ciphering and Integrity Keys for PS domain'),
EF_xPLMNwAcT('6f60', 0x0a, 'EF.PLMNwAcT',
- 'User controlled PLMN Selector with Access Technology', service=20),
+ desc='User controlled PLMN Selector with Access Technology', service=20),
EF_HPPLMN(),
EF_ACMmax(service=13),
EF_UST(),
CyclicEF('6f39', None, 'EF.ACM',
- 'Accumulated call meter', rec_len=(3, 3), service=13),
- TransparentEF('6f3e', None, 'EF.GID1', 'Group Identifier Level 1', service=17),
- TransparentEF('6f3f', None, 'EF.GID2', 'Group Identifier Level 2', service=18),
+ desc='Accumulated call meter', rec_len=(3, 3), service=13),
+ TransparentEF('6f3e', None, 'EF.GID1', desc='Group Identifier Level 1', service=17),
+ TransparentEF('6f3f', None, 'EF.GID2', desc='Group Identifier Level 2', service=18),
EF_SPN(service=19),
TransparentEF('6f41', None, 'EF.PUCT',
- 'Price per unit and currency table', size=(5, 5), service=13),
+ desc='Price per unit and currency table', size=(5, 5), service=13),
EF_CBMI(service=15),
EF_ACC(sfid=0x06),
- EF_PLMNsel('6f7b', 0x0d, 'EF.FPLMN',
- 'Forbidden PLMNs', size=(12, None)),
+ EF_PLMNsel('6f7b', 0x0d, 'EF.FPLMN', desc='Forbidden PLMNs', size=(12, None)),
EF_LOCI(),
EF_AD(),
EF_CBMID(sfid=0x0e, service=29),
EF_ECC(),
EF_CBMIR(service=16),
EF_PSLOCI(),
- EF_ADN('6f3b', None, 'EF.FDN', 'Fixed Dialling Numbers', service=[2, 89], ext=2),
+ EF_ADN('6f3b', None, 'EF.FDN', desc='Fixed Dialling Numbers', service=[2, 89], ext=2),
EF_SMS('6f3c', None, service=10),
EF_MSISDN(service=21),
EF_SMSP(service=12),
EF_SMSS(service=10),
- EF_ADN('6f49', None, 'EF.SDN', 'Service Dialling Numbers', service=[4, 89], ext=3),
- EF_EXT('6f4b', None, 'EF.EXT2', 'Extension2 (FDN)', service=3),
- EF_EXT('6f4c', None, 'EF.EXT3', 'Extension2 (SDN)', service=5),
+ EF_ADN('6f49', None, 'EF.SDN', desc='Service Dialling Numbers', service=[4, 89], ext=3),
+ EF_EXT('6f4b', None, 'EF.EXT2', desc='Extension2 (FDN)', service=3),
+ EF_EXT('6f4c', None, 'EF.EXT3', desc='Extension2 (SDN)', service=5),
EF_SMSR(service=11),
EF_ICI(service=9),
EF_OCI(service=8),
EF_ICT(service=9),
- EF_ICT('6f83', None, 'EF.OCT', 'Outgoing Call Timer', service=8),
- EF_EXT('6f4e', None, 'EF.EXT5', 'Extension5 (ICI/OCI/MSISDN)', service=44),
+ EF_ICT('6f83', None, 'EF.OCT', desc='Outgoing Call Timer', service=8),
+ EF_EXT('6f4e', None, 'EF.EXT5', desc='Extension5 (ICI/OCI/MSISDN)', service=44),
EF_CCP2(service=14),
EF_eMLPP(service=24),
EF_AAeM(service=25),
# EF_Hiddenkey
- EF_ADN('6f4d', None, 'EF.BDN', 'Barred Dialling Numbers', service=6, ext=4),
- EF_EXT('6f55', None, 'EF.EXT4', 'Extension4 (BDN/SSC)', service=7),
+ EF_ADN('6f4d', None, 'EF.BDN', desc='Barred Dialling Numbers', service=6, ext=4),
+ EF_EXT('6f55', None, 'EF.EXT4', desc='Extension4 (BDN/SSC)', service=7),
EF_CMI(service=6),
EF_EST(service=[2, 6, 34, 35]),
EF_ACL(service=35),
@@ -1430,52 +1429,52 @@
EF_CNL(service=37),
EF_START_HFN(),
EF_THRESHOLD(),
- EF_xPLMNwAcT('6f61', 0x11, 'EF.OPLMNwAcT', 'User controlled PLMN Selector with Access Technology', service=42),
- EF_xPLMNwAcT('6f62', 0x13, 'EF.HPLMNwAcT', 'HPLMN Selector with Access Technology', service=43),
+ EF_xPLMNwAcT('6f61', 0x11, 'EF.OPLMNwAcT', desc='User controlled PLMN Selector with Access Technology', service=42),
+ EF_xPLMNwAcT('6f62', 0x13, 'EF.HPLMNwAcT', desc='HPLMN Selector with Access Technology', service=43),
EF_ARR('6f06', 0x17),
EF_RPLMNAcT(),
- TransparentEF('6fc4', None, 'EF.NETPAR', 'Network Parameters'),
+ TransparentEF('6fc4', None, 'EF.NETPAR', desc='Network Parameters'),
EF_PNN('6fc5', 0x19, service=45),
EF_OPL(service=46),
- EF_ADN('6fc7', None, 'EF.MBDN', 'Mailbox Dialling Numbers', service=47, ext=6),
- EF_EXT('6fc8', None, 'EF.EXT6', 'Extension6 (MBDN)'),
+ EF_ADN('6fc7', None, 'EF.MBDN', desc='Mailbox Dialling Numbers', service=47, ext=6),
+ EF_EXT('6fc8', None, 'EF.EXT6', desc='Extension6 (MBDN)'),
EF_MBI(service=47),
EF_MWIS(service=48),
- EF_ADN('6fcb', None, 'EF.CFIS', 'Call Forwarding Indication Status', service=49, ext=7),
- EF_EXT('6fcc', None, 'EF.EXT7', 'Extension7 (CFIS)'),
- TransparentEF('6fcd', None, 'EF.SPDI', 'Service Provider Display Information', service=51),
+ EF_ADN('6fcb', None, 'EF.CFIS', desc='Call Forwarding Indication Status', service=49, ext=7),
+ EF_EXT('6fcc', None, 'EF.EXT7', desc='Extension7 (CFIS)'),
+ TransparentEF('6fcd', None, 'EF.SPDI', desc='Service Provider Display Information', service=51),
EF_MMSN(service=52),
- EF_EXT('6fcf', None, 'EF.EXT8', 'Extension8 (MMSN)', service=53),
+ EF_EXT('6fcf', None, 'EF.EXT8', desc='Extension8 (MMSN)', service=53),
EF_MMSICP(service=52),
EF_MMSUP(service=52),
EF_MMSUCP(service=(52, 55)),
EF_NIA(service=56, fid='6fd3'),
EF_VGCS(service=57),
EF_VGCSS(service=57),
- EF_VGCS('6fb3', None, 'EF.VBS', 'Voice Broadcast Service', service=58),
- EF_VGCSS('6fb4', None, 'EF.VBSS', 'Voice Broadcast Service Status', service=58),
+ EF_VGCS('6fb3', None, 'EF.VBS', desc='Voice Broadcast Service', service=58),
+ EF_VGCSS('6fb4', None, 'EF.VBSS', desc='Voice Broadcast Service Status', service=58),
EF_VGCSCA(service=64),
- EF_VGCSCA('6fd5', None, 'EF.VBCSCA', 'Voice Broadcast Service Ciphering Algorithm', service=65),
+ EF_VGCSCA('6fd5', None, 'EF.VBCSCA', desc='Voice Broadcast Service Ciphering Algorithm', service=65),
EF_GBABP(service=68),
EF_MSK(service=69),
EF_MUK(service=69),
EF_GBANL(service=68),
- EF_PLMNsel('6fd9', 0x1d, 'EF.EHPLMN', 'Equivalent HPLMN', size=(12, None), service=71),
+ EF_PLMNsel('6fd9', 0x1d, 'EF.EHPLMN', desc='Equivalent HPLMN', size=(12, None), service=71),
EF_EHPLMNPI(service=(71, 73)),
# EF_LRPLMNSI ('6fdc', service=74)
EF_NAFKCA(service=(68, 76)),
- TransparentEF('6fde', None, 'EF.SPNI', 'Service Provider Name Icon', service=78),
- LinFixedEF('6fdf', None, 'EF.PNNI', 'PLMN Network Name Icon', service=79),
+ TransparentEF('6fde', None, 'EF.SPNI', desc='Service Provider Name Icon', service=78),
+ LinFixedEF('6fdf', None, 'EF.PNNI', desc='PLMN Network Name Icon', service=79),
EF_NCP_IP(service=80),
- EF_EPSLOCI('6fe3', 0x1e, 'EF.EPSLOCI', 'EPS location information', service=85),
+ EF_EPSLOCI('6fe3', 0x1e, 'EF.EPSLOCI', desc='EPS location information', service=85),
EF_EPSNSC(service=85),
- TransparentEF('6fe6', None, 'EF.UFC', 'USAT Facility Control', size=(1, 16)),
- TransparentEF('6fe8', None, 'EF.NASCONFIG', 'Non Access Stratum Configuration', service=96),
+ TransparentEF('6fe6', None, 'EF.UFC', desc='USAT Facility Control', size=(1, 16)),
+ TransparentEF('6fe8', None, 'EF.NASCONFIG', desc='Non Access Stratum Configuration', service=96),
# UICC IARI (only in cards that have no ISIM) service=95
EF_PWS(service=97),
- LinFixedEF('6fed', None, 'EF.FDNURI', 'Fixed Dialling Numbers URI', service=(2, 99)),
- LinFixedEF('6fee', None, 'EF.BDNURI', 'Barred Dialling Numbers URI', service=(6, 99)),
- LinFixedEF('6fef', None, 'EF.SDNURI', 'Service Dialling Numbers URI', service=(4, 99)),
+ LinFixedEF('6fed', None, 'EF.FDNURI', desc='Fixed Dialling Numbers URI', service=(2, 99)),
+ LinFixedEF('6fee', None, 'EF.BDNURI', desc='Barred Dialling Numbers URI', service=(6, 99)),
+ LinFixedEF('6fef', None, 'EF.SDNURI', desc='Service Dialling Numbers URI', service=(4, 99)),
# EF_IWL (IMEI(SV) White List)
EF_IPS(),
EF_ePDGId(service=(106, 107)),
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index d8cbabd..14db686 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -927,32 +927,32 @@
EF_Kc(),
EF_PLMNsel(),
TransparentEF('6f31', None, 'EF.HPPLMN',
- 'Higher Priority PLMN search period'),
+ desc='Higher Priority PLMN search period'),
EF_ACMmax(),
EF_ServiceTable('6f38', None, 'EF.SST',
- 'SIM service table', table=EF_SST_map, size=(2, 16)),
+ desc='SIM service table', table=EF_SST_map, size=(2, 16)),
CyclicEF('6f39', None, 'EF.ACM',
- 'Accumulated call meter', rec_len=(3, 3)),
- TransparentEF('6f3e', None, 'EF.GID1', 'Group Identifier Level 1'),
- TransparentEF('6f3f', None, 'EF.GID2', 'Group Identifier Level 2'),
+ desc='Accumulated call meter', rec_len=(3, 3)),
+ TransparentEF('6f3e', None, 'EF.GID1', desc='Group Identifier Level 1'),
+ TransparentEF('6f3f', None, 'EF.GID2', desc='Group Identifier Level 2'),
EF_SPN(),
TransparentEF('6f41', None, 'EF.PUCT',
- 'Price per unit and currency table', size=(5, 5)),
+ desc='Price per unit and currency table', size=(5, 5)),
EF_CBMI(),
TransparentEF('6f74', None, 'EF.BCCH',
- 'Broadcast control channels', size=(16, 16)),
+ desc='Broadcast control channels', size=(16, 16)),
EF_ACC(),
EF_PLMNsel('6f7b', None, 'EF.FPLMN',
- 'Forbidden PLMNs', size=(12, 12)),
+ desc='Forbidden PLMNs', size=(12, 12)),
EF_LOCI(),
EF_AD(),
TransparentEF('6fae', None, 'EF.Phase',
- 'Phase identification', size=(1, 1)),
+ desc='Phase identification', size=(1, 1)),
EF_VGCS(),
EF_VGCSS(),
- EF_VGCS('6fb3', None, 'EF.VBS', 'Voice Broadcast Service'),
+ EF_VGCS('6fb3', None, 'EF.VBS', desc='Voice Broadcast Service'),
EF_VGCSS('6fb4', None, 'EF.VBSS',
- 'Voice Broadcast Service Status'),
+ desc='Voice Broadcast Service Status'),
EF_eMLPP(),
EF_AAeM(),
EF_CBMID(),
@@ -961,29 +961,29 @@
EF_DCK(),
EF_CNL(),
EF_NIA(),
- EF_Kc('6f52', None, 'EF.KcGPRS', 'GPRS Ciphering key KcGPRS'),
+ EF_Kc('6f52', None, 'EF.KcGPRS', desc='GPRS Ciphering key KcGPRS'),
EF_LOCIGPRS(),
- TransparentEF('6f54', None, 'EF.SUME', 'SetUpMenu Elements'),
+ TransparentEF('6f54', None, 'EF.SUME', desc='SetUpMenu Elements'),
EF_xPLMNwAcT('6f60', None, 'EF.PLMNwAcT',
- 'User controlled PLMN Selector with Access Technology'),
+ desc='User controlled PLMN Selector with Access Technology'),
EF_xPLMNwAcT('6f61', None, 'EF.OPLMNwAcT',
- 'Operator controlled PLMN Selector with Access Technology'),
+ desc='Operator controlled PLMN Selector with Access Technology'),
EF_xPLMNwAcT('6f62', None, 'EF.HPLMNwAcT',
- 'HPLMN Selector with Access Technology'),
+ desc='HPLMN Selector with Access Technology'),
EF_CPBCCH(),
EF_InvScan(),
EF_PNN(),
EF_OPL(),
- EF_ADN('6fc7', None, 'EF.MBDN', 'Mailbox Dialling Numbers'),
+ EF_ADN('6fc7', None, 'EF.MBDN', desc='Mailbox Dialling Numbers'),
EF_MBI(),
EF_MWIS(),
EF_ADN('6fcb', None, 'EF.CFIS',
- 'Call Forwarding Indication Status'),
- EF_EXT('6fc8', None, 'EF.EXT6', 'Externsion6 (MBDN)'),
- EF_EXT('6fcc', None, 'EF.EXT7', 'Externsion7 (CFIS)'),
+ desc='Call Forwarding Indication Status'),
+ EF_EXT('6fc8', None, 'EF.EXT6', desc='Externsion6 (MBDN)'),
+ EF_EXT('6fcc', None, 'EF.EXT7', desc='Externsion7 (CFIS)'),
EF_SPDI(),
EF_MMSN(),
- EF_EXT('6fcf', None, 'EF.EXT8', 'Extension8 (MMSN)'),
+ EF_EXT('6fcf', None, 'EF.EXT8', desc='Extension8 (MMSN)'),
EF_MMSICP(),
EF_MMSUP(),
EF_MMSUCP(),
To view, visit change 34814. To unsubscribe, or for help writing mail filters, visit settings.