<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23712">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix various typos all over the code<br><br>Change-Id: Ic8392a951bf94f67b51e35bed95d0e856f7a9250<br>---<br>M docs/library.rst<br>M pySim-shell.py<br>M pySim/cards.py<br>M pySim/filesystem.py<br>M pySim/ts_31_102.py<br>M pySim/ts_31_103.py<br>M pySim/ts_51_011.py<br>M pySim/utils.py<br>8 files changed, 29 insertions(+), 29 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/12/23712/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/docs/library.rst b/docs/library.rst</span><br><span>index e2e24a7..f531ec5 100644</span><br><span>--- a/docs/library.rst</span><br><span>+++ b/docs/library.rst</span><br><span>@@ -33,7 +33,7 @@</span><br><span> calypso / OsmocomBB transport</span><br><span> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-This allows the use of the SIM slot of an an OsmocomBB compatible phone with the TI Calypso chipset,</span><br><span style="color: hsl(120, 100%, 40%);">+This allows the use of the SIM slot of an OsmocomBB compatible phone with the TI Calypso chipset,</span><br><span> using the L1CTL interface to talk to the layer1.bin firmware on the phone.</span><br><span> </span><br><span> .. automodule:: pySim.transport.calypso</span><br><span>@@ -67,7 +67,7 @@</span><br><span> This transport implements interfacing smart cards via</span><br><span> very simplistic UART readers.  These readers basically</span><br><span> wire together the Rx+Tx pins of a RS232 UART, provide</span><br><span style="color: hsl(0, 100%, 40%);">-a fixed crystal oscilator for clock, and operate the UART</span><br><span style="color: hsl(120, 100%, 40%);">+a fixed crystal oscillator for clock, and operate the UART</span><br><span> at 9600 bps.  These readers are sometimes called `Phoenix`.</span><br><span> </span><br><span> .. automodule:: pySim.transport.serial</span><br><span>diff --git a/pySim-shell.py b/pySim-shell.py</span><br><span>index 132733d..5298cb4 100755</span><br><span>--- a/pySim-shell.py</span><br><span>+++ b/pySim-shell.py</span><br><span>@@ -79,7 +79,7 @@</span><br><span>                                             onchange_cb=self._onchange_apdu_trace))</span><br><span> </span><br><span>        def poutput_json(self, data, force_no_pretty = False):</span><br><span style="color: hsl(0, 100%, 40%);">-          """line cmd2.putput() but for a json serializable dict."""</span><br><span style="color: hsl(120, 100%, 40%);">+              """like cmd2.poutput() but for a JSON serializable dict."""</span><br><span>            if force_no_pretty or self.json_pretty_print == False:</span><br><span>                       output = json.dumps(data, cls=JsonEncoder)</span><br><span>           else:</span><br><span>@@ -220,7 +220,7 @@</span><br><span>                          # always restore the currently selected file to the file that</span><br><span>                                # was selected before executing the action() callback.</span><br><span>                               if df_before_action != self._cmd.rs.selected_file:</span><br><span style="color: hsl(0, 100%, 40%);">-                                      raise RuntimeError("inconsistant walk, %s is currently selected but expecting %s to be selected"</span><br><span style="color: hsl(120, 100%, 40%);">+                                    raise RuntimeError("inconsistent walk, %s is currently selected but expecting %s to be selected"</span><br><span>                                                      % (str(self._cmd.rs.selected_file), str(df_before_action)))</span><br><span> </span><br><span>   def do_tree(self, opts):</span><br><span>@@ -299,9 +299,9 @@</span><br><span>                       self._cmd.poutput("#  " + b)</span><br><span> </span><br><span>           if context['ERR'] and context['DF_SKIP']:</span><br><span style="color: hsl(0, 100%, 40%);">-                       raise RuntimeError("unable to export %i elementry file(s) and %i dedicated file(s)" % (context['ERR'], context['DF_SKIP']))</span><br><span style="color: hsl(120, 100%, 40%);">+                 raise RuntimeError("unable to export %i elementary file(s) and %i dedicated file(s)" % (context['ERR'], context['DF_SKIP']))</span><br><span>               elif context['ERR']:</span><br><span style="color: hsl(0, 100%, 40%);">-                    raise RuntimeError("unable to export %i elementry file(s)" % context['ERR'])</span><br><span style="color: hsl(120, 100%, 40%);">+                        raise RuntimeError("unable to export %i elementary file(s)" % context['ERR'])</span><br><span>              elif context['DF_SKIP']:</span><br><span>                     raise RuntimeError("unable to export %i dedicated files(s)" % context['ERR'])</span><br><span> </span><br><span>@@ -353,7 +353,7 @@</span><br><span>            """Verify (authenticate) using specified PIN code"""</span><br><span>           pin = self.get_code(opts.pin_code)</span><br><span>           (data, sw) = self._cmd.card._scc.verify_chv(opts.pin_nr, h2b(pin))</span><br><span style="color: hsl(0, 100%, 40%);">-              self._cmd.poutput("CHV verfication successful")</span><br><span style="color: hsl(120, 100%, 40%);">+             self._cmd.poutput("CHV verification successful")</span><br><span> </span><br><span>       unblock_chv_parser = argparse.ArgumentParser()</span><br><span>       unblock_chv_parser.add_argument('--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or custom value (decimal)')</span><br><span>@@ -536,7 +536,7 @@</span><br><span>          card_key_provider_register(CardKeyProviderCsv(csv_default))</span><br><span> </span><br><span>      # If the user supplies an ADM PIN at via commandline args authenticate</span><br><span style="color: hsl(0, 100%, 40%);">-  # immediatley so that the user does not have to use the shell commands</span><br><span style="color: hsl(120, 100%, 40%);">+        # immediately so that the user does not have to use the shell commands</span><br><span>       pin_adm = sanitize_pin_adm(opts.pin_adm, opts.pin_adm_hex)</span><br><span>   if pin_adm:</span><br><span>          try:</span><br><span>diff --git a/pySim/cards.py b/pySim/cards.py</span><br><span>index 8ac80bf..d630282 100644</span><br><span>--- a/pySim/cards.py</span><br><span>+++ b/pySim/cards.py</span><br><span>@@ -94,7 +94,7 @@</span><br><span>                in ETSI TS 151 011 for the details of the access_tech field coding.</span><br><span>          Some common values:</span><br><span>          access_tech = '0080' # Only GSM is selected</span><br><span style="color: hsl(0, 100%, 40%);">-             access_tech = 'FFFF' # All technologues selected, even Reserved for Future Use ones</span><br><span style="color: hsl(120, 100%, 40%);">+           access_tech = 'FFFF' # All technologies selected, even Reserved for Future Use ones</span><br><span>          """</span><br><span>           # get size and write EF.HPLMNwAcT</span><br><span>            data = self._scc.read_binary(EF['HPLMNwAcT'], length=None, offset=0)</span><br><span>@@ -446,7 +446,7 @@</span><br><span>   each possible provider uses a specific record number in each EF. The</span><br><span>         indexes used are ( where N is the number of providers supported ) :</span><br><span>   - [2 .. N+1] for the operator name</span><br><span style="color: hsl(0, 100%, 40%);">-      - [1 .. N] for the programable EFs</span><br><span style="color: hsl(120, 100%, 40%);">+    - [1 .. N] for the programmable EFs</span><br><span> </span><br><span>     * 3f00/7f4d/8f0c : Operator Name</span><br><span> </span><br><span>@@ -588,7 +588,7 @@</span><br><span> class FakeMagicSim(Card):</span><br><span>      """</span><br><span>   Theses cards have a record based EF 3f00/000c that contains the provider</span><br><span style="color: hsl(0, 100%, 40%);">-        informations. See the program method for its format. The records go from</span><br><span style="color: hsl(120, 100%, 40%);">+      information. See the program method for its format. The records go from</span><br><span>      1 to N.</span><br><span>      """</span><br><span> </span><br><span>diff --git a/pySim/filesystem.py b/pySim/filesystem.py</span><br><span>index 49520c3..36588e2 100644</span><br><span>--- a/pySim/filesystem.py</span><br><span>+++ b/pySim/filesystem.py</span><br><span>@@ -53,7 +53,7 @@</span><br><span>             fid : File Identifier (4 hex digits)</span><br><span>             sfid : Short File Identifier (2 hex digits, optional)</span><br><span>             name : Brief name of the file, lik EF_ICCID</span><br><span style="color: hsl(0, 100%, 40%);">-            desc : Descriptoin of the file</span><br><span style="color: hsl(120, 100%, 40%);">+            desc : Description of the file</span><br><span>             parent : Parent CardFile object within filesystem hierarchy</span><br><span>         """</span><br><span>         if not isinstance(self, CardADF) and fid == None:</span><br><span>@@ -387,7 +387,7 @@</span><br><span> </span><br><span>     @with_default_category('Transparent EF Commands')</span><br><span>     class ShellCommands(CommandSet):</span><br><span style="color: hsl(0, 100%, 40%);">-        """Shell commands specific for Trransparent EFs."""</span><br><span style="color: hsl(120, 100%, 40%);">+        """Shell commands specific for transparent EFs."""</span><br><span>         def __init__(self):</span><br><span>             super().__init__()</span><br><span> </span><br><span>@@ -462,7 +462,7 @@</span><br><span>             fid : File Identifier (4 hex digits)</span><br><span>             sfid : Short File Identifier (2 hex digits, optional)</span><br><span>             name : Brief name of the file, lik EF_ICCID</span><br><span style="color: hsl(0, 100%, 40%);">-            desc : Descriptoin of the file</span><br><span style="color: hsl(120, 100%, 40%);">+            desc : Description of the file</span><br><span>             parent : Parent CardFile object within filesystem hierarchy</span><br><span>             size : tuple of (minimum_size, recommended_size)</span><br><span>         """</span><br><span>@@ -686,7 +686,7 @@</span><br><span>             fid : File Identifier (4 hex digits)</span><br><span>             sfid : Short File Identifier (2 hex digits, optional)</span><br><span>             name : Brief name of the file, lik EF_ICCID</span><br><span style="color: hsl(0, 100%, 40%);">-            desc : Descriptoin of the file</span><br><span style="color: hsl(120, 100%, 40%);">+            desc : Description of the file</span><br><span>             parent : Parent CardFile object within filesystem hierarchy</span><br><span>             rec_len : tuple of (minimum_length, recommended_length)</span><br><span>         """</span><br><span>@@ -808,8 +808,8 @@</span><br><span>         Args:</span><br><span>             fid : File Identifier (4 hex digits)</span><br><span>             sfid : Short File Identifier (2 hex digits, optional)</span><br><span style="color: hsl(0, 100%, 40%);">-            name : Brief name of the file, lik EF_ICCID</span><br><span style="color: hsl(0, 100%, 40%);">-            desc : Descriptoin of the file</span><br><span style="color: hsl(120, 100%, 40%);">+            name : Brief name of the file, like EF_ICCID</span><br><span style="color: hsl(120, 100%, 40%);">+            desc : Description of the file</span><br><span>             parent : Parent CardFile object within filesystem hierarchy</span><br><span>             rec_len : Length of the fixed-length records within transparent EF</span><br><span>             size : tuple of (minimum_size, recommended_size)</span><br><span>@@ -991,7 +991,7 @@</span><br><span>         or the underlying card profile.</span><br><span> </span><br><span>         Args:</span><br><span style="color: hsl(0, 100%, 40%);">-            sw : Status word as string of 4 hexd digits</span><br><span style="color: hsl(120, 100%, 40%);">+            sw : Status word as string of 4 hex digits</span><br><span> </span><br><span>         Returns:</span><br><span>             Tuple of two strings</span><br><span>@@ -1026,9 +1026,9 @@</span><br><span>             f = CardDF(fid=fid, sfid=None, name="DF." + str(fid).upper(), desc="dedicated file, manually added at runtime")</span><br><span>         else:</span><br><span>             if (select_resp['file_descriptor']['structure'] == 'transparent'):</span><br><span style="color: hsl(0, 100%, 40%);">-                f = TransparentEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementry file, manually added at runtime")</span><br><span style="color: hsl(120, 100%, 40%);">+                f = TransparentEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementary file, manually added at runtime")</span><br><span>             else:</span><br><span style="color: hsl(0, 100%, 40%);">-                f = LinFixedEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementry file, manually added at runtime")</span><br><span style="color: hsl(120, 100%, 40%);">+                f = LinFixedEF(fid=fid, sfid=None, name="EF." + str(fid).upper(), desc="elementary file, manually added at runtime")</span><br><span> </span><br><span>         self.selected_file.add_files([f])</span><br><span>         self.selected_file = f</span><br><span>@@ -1223,7 +1223,7 @@</span><br><span>         """Interpret a given status word within the application.</span><br><span> </span><br><span>         Args:</span><br><span style="color: hsl(0, 100%, 40%);">-            sw : Status word as string of 4 hexd digits</span><br><span style="color: hsl(120, 100%, 40%);">+            sw : Status word as string of 4 hex digits</span><br><span> </span><br><span>         Returns:</span><br><span>             Tuple of two strings</span><br><span>@@ -1231,7 +1231,7 @@</span><br><span>         return interpret_sw(self.sw, sw)</span><br><span> </span><br><span> class CardProfile(object):</span><br><span style="color: hsl(0, 100%, 40%);">-    """A Card Profile describes a card, it's filessystem hierarchy, an [initial] list of</span><br><span style="color: hsl(120, 100%, 40%);">+    """A Card Profile describes a card, it's filesystem hierarchy, an [initial] list of</span><br><span>        applications as well as profile-specific SW and shell commands.  Every card has</span><br><span>        one card profile, but there may be multiple applications within that profile."""</span><br><span>     def __init__(self, name, **kw):</span><br><span>@@ -1265,7 +1265,7 @@</span><br><span>         """Interpret a given status word within the profile.</span><br><span> </span><br><span>         Args:</span><br><span style="color: hsl(0, 100%, 40%);">-            sw : Status word as string of 4 hexd digits</span><br><span style="color: hsl(120, 100%, 40%);">+            sw : Status word as string of 4 hex digits</span><br><span> </span><br><span>         Returns:</span><br><span>             Tuple of two strings</span><br><span>diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py</span><br><span>index 1558d8d..1a78a12 100644</span><br><span>--- a/pySim/ts_31_102.py</span><br><span>+++ b/pySim/ts_31_102.py</span><br><span>@@ -471,14 +471,14 @@</span><br><span> </span><br><span> # TS 31.102 Section 4.2.17</span><br><span> class EF_LOCI(TransparentEF):</span><br><span style="color: hsl(0, 100%, 40%);">-    def __init__(self, fid='6f7e', sfid=0x0b, name='EF.LOCI', desc='Locationn information', size={11,11}):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, fid='6f7e', sfid=0x0b, name='EF.LOCI', desc='Location information', size={11,11}):</span><br><span>         super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)</span><br><span>         self._construct = Struct('tmsi'/HexAdapter(Bytes(4)), 'lai'/HexAdapter(Bytes(5)), 'rfu'/Int8ub,</span><br><span>                                  'lu_status'/Int8ub)</span><br><span> </span><br><span> # TS 31.102 Section 4.2.23</span><br><span> class EF_PSLOCI(TransparentEF):</span><br><span style="color: hsl(0, 100%, 40%);">-    def __init__(self, fid='6f73', sfid=0x0c, name='EF.PSLOCI', desc='PS Locationn information', size={14,14}):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, fid='6f73', sfid=0x0c, name='EF.PSLOCI', desc='PS Location information', size={14,14}):</span><br><span>         super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size)</span><br><span>         self._construct = Struct('ptmsi'/HexAdapter(Bytes(4)), 'ptmsi_sig'/HexAdapter(Bytes(3)),</span><br><span>                                  'rai'/HexAdapter(Bytes(6)), 'rau_status'/Int8ub)</span><br><span>diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py</span><br><span>index effdbf7..cea4832 100644</span><br><span>--- a/pySim/ts_31_103.py</span><br><span>+++ b/pySim/ts_31_103.py</span><br><span>@@ -126,7 +126,7 @@</span><br><span> </span><br><span> # TS 31.103 Section 4.2.9</span><br><span> class EF_GBABP(TransparentEF):</span><br><span style="color: hsl(0, 100%, 40%);">-    def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA Bootstrappng'):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA Bootstrapping'):</span><br><span>         super().__init__(fid=fid, sfid=sfid, name=name, desc=desc)</span><br><span> </span><br><span> # TS 31.103 Section 4.2.10</span><br><span>diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py</span><br><span>index 5795faf..c21e86c 100644</span><br><span>--- a/pySim/ts_51_011.py</span><br><span>+++ b/pySim/ts_51_011.py</span><br><span>@@ -423,7 +423,7 @@</span><br><span> # TS 51.011 Section 10.5.16</span><br><span> class EF_CMI(LinFixedEF):</span><br><span>     def __init__(self, fid='6f58', sfid=None, name='EF.CMI', rec_len={2,21},</span><br><span style="color: hsl(0, 100%, 40%);">-                 desc='Comparison Method Informatoin'):</span><br><span style="color: hsl(120, 100%, 40%);">+                 desc='Comparison Method Information'):</span><br><span>         super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=rec_len)</span><br><span>         self._construct = Struct('alpha_id'/Bytes(this._.total_len-1), 'comparison_method_id'/Int8ub)</span><br><span> </span><br><span>@@ -871,7 +871,7 @@</span><br><span>         ret['file_characteristics'] = b2h(resp_bin[13])</span><br><span>         ret['num_direct_child_df'] = int(resp_bin[14], 16)</span><br><span>         ret['num_direct_child_ef'] = int(resp_bin[15], 16)</span><br><span style="color: hsl(0, 100%, 40%);">-        ret['num_chv_unbkock_adm_codes'] = int(resp_bin[16])</span><br><span style="color: hsl(120, 100%, 40%);">+        ret['num_chv_unblock_adm_codes'] = int(resp_bin[16])</span><br><span>         # CHV / UNBLOCK CHV stats</span><br><span>     elif file_type in ['working_ef']:</span><br><span>         file_struct = struct_of_file_map[resp_bin[13]] if resp_bin[13] in struct_of_file_map else resp_bin[13]</span><br><span>diff --git a/pySim/utils.py b/pySim/utils.py</span><br><span>index 5f66170..a0da03a 100644</span><br><span>--- a/pySim/utils.py</span><br><span>+++ b/pySim/utils.py</span><br><span>@@ -111,7 +111,7 @@</span><br><span>        return ei</span><br><span> </span><br><span> def dec_imsi(ef:Hexstr) -> Optional[str]:</span><br><span style="color: hsl(0, 100%, 40%);">-   """Converts an EF value to the imsi string representation"""</span><br><span style="color: hsl(120, 100%, 40%);">+    """Converts an EF value to the IMSI string representation"""</span><br><span>   if len(ef) < 4:</span><br><span>           return None</span><br><span>  l = int(ef[0:2], 16) * 2                # Length of the IMSI string</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23712">change 23712</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/23712"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic8392a951bf94f67b51e35bed95d0e856f7a9250 </div>
<div style="display:none"> Gerrit-Change-Number: 23712 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>