Change in pysim[master]: fix various typos all over the code

laforge gerrit-no-reply at lists.osmocom.org
Mon Apr 12 08:07:56 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/23712 )

Change subject: fix various typos all over the code
......................................................................

fix various typos all over the code

Change-Id: Ic8392a951bf94f67b51e35bed95d0e856f7a9250
---
M docs/library.rst
M pySim-shell.py
M pySim/cards.py
M pySim/filesystem.py
M pySim/ts_31_102.py
M pySim/ts_31_103.py
M pySim/ts_51_011.py
M pySim/utils.py
8 files changed, 29 insertions(+), 29 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/docs/library.rst b/docs/library.rst
index e2e24a7..f531ec5 100644
--- a/docs/library.rst
+++ b/docs/library.rst
@@ -33,7 +33,7 @@
 calypso / OsmocomBB transport
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This allows the use of the SIM slot of an an OsmocomBB compatible phone with the TI Calypso chipset,
+This allows the use of the SIM slot of an OsmocomBB compatible phone with the TI Calypso chipset,
 using the L1CTL interface to talk to the layer1.bin firmware on the phone.
 
 .. automodule:: pySim.transport.calypso
@@ -67,7 +67,7 @@
 This transport implements interfacing smart cards via
 very simplistic UART readers.  These readers basically
 wire together the Rx+Tx pins of a RS232 UART, provide
-a fixed crystal oscilator for clock, and operate the UART
+a fixed crystal oscillator for clock, and operate the UART
 at 9600 bps.  These readers are sometimes called `Phoenix`.
 
 .. automodule:: pySim.transport.serial
diff --git a/pySim-shell.py b/pySim-shell.py
index 132733d..5298cb4 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -79,7 +79,7 @@
 						  onchange_cb=self._onchange_apdu_trace))
 
 	def poutput_json(self, data, force_no_pretty = False):
-		"""line cmd2.putput() but for a json serializable dict."""
+		"""like cmd2.poutput() but for a JSON serializable dict."""
 		if force_no_pretty or self.json_pretty_print == False:
 			output = json.dumps(data, cls=JsonEncoder)
 		else:
@@ -220,7 +220,7 @@
 				# always restore the currently selected file to the file that
 				# was selected before executing the action() callback.
 				if df_before_action != self._cmd.rs.selected_file:
-					raise RuntimeError("inconsistant walk, %s is currently selected but expecting %s to be selected"
+					raise RuntimeError("inconsistent walk, %s is currently selected but expecting %s to be selected"
 							   % (str(self._cmd.rs.selected_file), str(df_before_action)))
 
 	def do_tree(self, opts):
@@ -299,9 +299,9 @@
 			self._cmd.poutput("#  " + b)
 
 		if context['ERR'] and context['DF_SKIP']:
-			raise RuntimeError("unable to export %i elementry file(s) and %i dedicated file(s)" % (context['ERR'], context['DF_SKIP']))
+			raise RuntimeError("unable to export %i elementary file(s) and %i dedicated file(s)" % (context['ERR'], context['DF_SKIP']))
 		elif context['ERR']:
-			raise RuntimeError("unable to export %i elementry file(s)" % context['ERR'])
+			raise RuntimeError("unable to export %i elementary file(s)" % context['ERR'])
 		elif context['DF_SKIP']:
 			raise RuntimeError("unable to export %i dedicated files(s)" % context['ERR'])
 
@@ -353,7 +353,7 @@
 		"""Verify (authenticate) using specified PIN code"""
 		pin = self.get_code(opts.pin_code)
 		(data, sw) = self._cmd.card._scc.verify_chv(opts.pin_nr, h2b(pin))
-		self._cmd.poutput("CHV verfication successful")
+		self._cmd.poutput("CHV verification successful")
 
 	unblock_chv_parser = argparse.ArgumentParser()
 	unblock_chv_parser.add_argument('--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or custom value (decimal)')
@@ -536,7 +536,7 @@
 		card_key_provider_register(CardKeyProviderCsv(csv_default))
 
 	# If the user supplies an ADM PIN at via commandline args authenticate
-	# immediatley so that the user does not have to use the shell commands
+	# immediately so that the user does not have to use the shell commands
 	pin_adm = sanitize_pin_adm(opts.pin_adm, opts.pin_adm_hex)
 	if pin_adm:
 		try:
diff --git a/pySim/cards.py b/pySim/cards.py
index 8489c97..5a39bda 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -94,7 +94,7 @@
 		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 @@
 	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 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.
 	"""
 
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 49520c3..36588e2 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -53,7 +53,7 @@
             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 @@
 
     @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 @@
             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 @@
             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 @@
         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 @@
         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 @@
             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 @@
         """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 @@
         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 @@
         """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
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index 1558d8d..1a78a12 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -471,14 +471,14 @@
 
 # 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)
diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index effdbf7..cea4832 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -126,7 +126,7 @@
 
 # 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
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index 5795faf..c21e86c 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -423,7 +423,7 @@
 # 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 @@
         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]
diff --git a/pySim/utils.py b/pySim/utils.py
index 5f66170..a0da03a 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -111,7 +111,7 @@
 	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

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/23712
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic8392a951bf94f67b51e35bed95d0e856f7a9250
Gerrit-Change-Number: 23712
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210412/bdc021bd/attachment.htm>


More information about the gerrit-log mailing list