fix various typos all over the code

Change-Id: Ic8392a951bf94f67b51e35bed95d0e856f7a9250
This commit is contained in:
Harald Welte
2021-04-11 10:28:28 +02:00
parent 790b2709bd
commit c9cdce3e02
8 changed files with 29 additions and 29 deletions

View File

@@ -94,7 +94,7 @@ class Card(object):
in ETSI TS 151 011 for the details of the access_tech field coding.
Some common values:
access_tech = '0080' # Only GSM is selected
access_tech = 'FFFF' # All technologues selected, even Reserved for Future Use ones
access_tech = 'FFFF' # All technologies selected, even Reserved for Future Use ones
"""
# get size and write EF.HPLMNwAcT
data = self._scc.read_binary(EF['HPLMNwAcT'], length=None, offset=0)
@@ -476,7 +476,7 @@ class _MagicSimBase(Card):
each possible provider uses a specific record number in each EF. The
indexes used are ( where N is the number of providers supported ) :
- [2 .. N+1] for the operator name
- [1 .. N] for the programable EFs
- [1 .. N] for the programmable EFs
* 3f00/7f4d/8f0c : Operator Name
@@ -618,7 +618,7 @@ class MagicSim(_MagicSimBase):
class FakeMagicSim(Card):
"""
Theses cards have a record based EF 3f00/000c that contains the provider
informations. See the program method for its format. The records go from
information. See the program method for its format. The records go from
1 to N.
"""

View File

@@ -53,7 +53,7 @@ class CardFile(object):
fid : File Identifier (4 hex digits)
sfid : Short File Identifier (2 hex digits, optional)
name : Brief name of the file, lik EF_ICCID
desc : Descriptoin of the file
desc : Description of the file
parent : Parent CardFile object within filesystem hierarchy
"""
if not isinstance(self, CardADF) and fid == None:
@@ -387,7 +387,7 @@ class TransparentEF(CardEF):
@with_default_category('Transparent EF Commands')
class ShellCommands(CommandSet):
"""Shell commands specific for Trransparent EFs."""
"""Shell commands specific for transparent EFs."""
def __init__(self):
super().__init__()
@@ -462,7 +462,7 @@ class TransparentEF(CardEF):
fid : File Identifier (4 hex digits)
sfid : Short File Identifier (2 hex digits, optional)
name : Brief name of the file, lik EF_ICCID
desc : Descriptoin of the file
desc : Description of the file
parent : Parent CardFile object within filesystem hierarchy
size : tuple of (minimum_size, recommended_size)
"""
@@ -686,7 +686,7 @@ class LinFixedEF(CardEF):
fid : File Identifier (4 hex digits)
sfid : Short File Identifier (2 hex digits, optional)
name : Brief name of the file, lik EF_ICCID
desc : Descriptoin of the file
desc : Description of the file
parent : Parent CardFile object within filesystem hierarchy
rec_len : tuple of (minimum_length, recommended_length)
"""
@@ -808,8 +808,8 @@ class TransRecEF(TransparentEF):
Args:
fid : File Identifier (4 hex digits)
sfid : Short File Identifier (2 hex digits, optional)
name : Brief name of the file, lik EF_ICCID
desc : Descriptoin of the file
name : Brief name of the file, like EF_ICCID
desc : Description of the file
parent : Parent CardFile object within filesystem hierarchy
rec_len : Length of the fixed-length records within transparent EF
size : tuple of (minimum_size, recommended_size)
@@ -991,7 +991,7 @@ class RuntimeState(object):
or the underlying card profile.
Args:
sw : Status word as string of 4 hexd digits
sw : Status word as string of 4 hex digits
Returns:
Tuple of two strings
@@ -1026,9 +1026,9 @@ class RuntimeState(object):
f = CardDF(fid=fid, sfid=None, name="DF." + str(fid).upper(), desc="dedicated file, manually added at runtime")
else:
if (select_resp['file_descriptor']['structure'] == 'transparent'):
f = TransparentEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementry file, manually added at runtime")
f = TransparentEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementary file, manually added at runtime")
else:
f = LinFixedEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementry file, manually added at runtime")
f = LinFixedEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementary file, manually added at runtime")
self.selected_file.add_files([f])
self.selected_file = f
@@ -1223,7 +1223,7 @@ class CardApplication(object):
"""Interpret a given status word within the application.
Args:
sw : Status word as string of 4 hexd digits
sw : Status word as string of 4 hex digits
Returns:
Tuple of two strings
@@ -1231,7 +1231,7 @@ class CardApplication(object):
return interpret_sw(self.sw, sw)
class CardProfile(object):
"""A Card Profile describes a card, it's filessystem hierarchy, an [initial] list of
"""A Card Profile describes a card, it's filesystem hierarchy, an [initial] list of
applications as well as profile-specific SW and shell commands. Every card has
one card profile, but there may be multiple applications within that profile."""
def __init__(self, name, **kw):
@@ -1265,7 +1265,7 @@ class CardProfile(object):
"""Interpret a given status word within the profile.
Args:
sw : Status word as string of 4 hexd digits
sw : Status word as string of 4 hex digits
Returns:
Tuple of two strings

View File

@@ -471,14 +471,14 @@ class EF_ECC(LinFixedEF):
# TS 31.102 Section 4.2.17
class EF_LOCI(TransparentEF):
def __init__(self, fid='6f7e', sfid=0x0b, name='EF.LOCI', desc='Locationn information', size={11,11}):
def __init__(self, fid='6f7e', sfid=0x0b, name='EF.LOCI', desc='Location information', size={11,11}):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
self._construct = Struct('tmsi'/HexAdapter(Bytes(4)), 'lai'/HexAdapter(Bytes(5)), 'rfu'/Int8ub,
'lu_status'/Int8ub)
# TS 31.102 Section 4.2.23
class EF_PSLOCI(TransparentEF):
def __init__(self, fid='6f73', sfid=0x0c, name='EF.PSLOCI', desc='PS Locationn information', size={14,14}):
def __init__(self, fid='6f73', sfid=0x0c, name='EF.PSLOCI', desc='PS Location information', size={14,14}):
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)
self._construct = Struct('ptmsi'/HexAdapter(Bytes(4)), 'ptmsi_sig'/HexAdapter(Bytes(3)),
'rai'/HexAdapter(Bytes(6)), 'rau_status'/Int8ub)

View File

@@ -126,7 +126,7 @@ class EF_PCSCF(LinFixedEF):
# TS 31.103 Section 4.2.9
class EF_GBABP(TransparentEF):
def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA Bootstrappng'):
def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA Bootstrapping'):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc)
# TS 31.103 Section 4.2.10

View File

@@ -423,7 +423,7 @@ class EF_EXT(LinFixedEF):
# TS 51.011 Section 10.5.16
class EF_CMI(LinFixedEF):
def __init__(self, fid='6f58', sfid=None, name='EF.CMI', rec_len={2,21},
desc='Comparison Method Informatoin'):
desc='Comparison Method Information'):
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len)
self._construct = Struct('alpha_id'/Bytes(this._.total_len-1), 'comparison_method_id'/Int8ub)
@@ -871,7 +871,7 @@ def decode_select_response(resp_hex):
ret['file_characteristics'] = b2h(resp_bin[13])
ret['num_direct_child_df'] = int(resp_bin[14], 16)
ret['num_direct_child_ef'] = int(resp_bin[15], 16)
ret['num_chv_unbkock_adm_codes'] = int(resp_bin[16])
ret['num_chv_unblock_adm_codes'] = int(resp_bin[16])
# CHV / UNBLOCK CHV stats
elif file_type in ['working_ef']:
file_struct = struct_of_file_map[resp_bin[13]] if resp_bin[13] in struct_of_file_map else resp_bin[13]

View File

@@ -111,7 +111,7 @@ def enc_imsi(imsi:str):
return ei
def dec_imsi(ef:Hexstr) -> Optional[str]:
"""Converts an EF value to the imsi string representation"""
"""Converts an EF value to the IMSI string representation"""
if len(ef) < 4:
return None
l = int(ef[0:2], 16) * 2 # Length of the IMSI string