<p>herlesupreeth has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/18195">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Import function for converting bytes list in (hex or int) to string from https://github.com/mitshell/card<br><br>This function is needed for conversion of bytes list output of TLV parser to representable string.<br>This function is imported from the git commit 2a81963790e27eb6b188359af169c45afb6d3aaf of master branch<br><br>Change-Id: I8c1e39ccf9fb517d465e73f69c720e7fdde02ded<br>---<br>M pySim/utils.py<br>1 file changed, 17 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/95/18195/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/utils.py b/pySim/utils.py</span><br><span>index eb7a56b..48af020 100644</span><br><span>--- a/pySim/utils.py</span><br><span>+++ b/pySim/utils.py</span><br><span>@@ -398,3 +398,20 @@</span><br><span>             else:</span><br><span>                        bytelist = bytelist[ L+2 : ]</span><br><span>         return ret</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# equivalent to the pyscard function "toASCIIString"</span><br><span style="color: hsl(120, 100%, 40%);">+def byteToString(bytelist):</span><br><span style="color: hsl(120, 100%, 40%);">+     '''</span><br><span style="color: hsl(120, 100%, 40%);">+       byteToString([116, 101, 115, 116]) -> 'test'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     converts a list of bytes into a string</span><br><span style="color: hsl(120, 100%, 40%);">+        '''</span><br><span style="color: hsl(120, 100%, 40%);">+       import sys</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if sys.version_info[0] < 3:</span><br><span style="color: hsl(120, 100%, 40%);">+                string = ''</span><br><span style="color: hsl(120, 100%, 40%);">+           for b in bytelist:</span><br><span style="color: hsl(120, 100%, 40%);">+                    string += chr(b)</span><br><span style="color: hsl(120, 100%, 40%);">+              return string</span><br><span style="color: hsl(120, 100%, 40%);">+ else:</span><br><span style="color: hsl(120, 100%, 40%);">+         return bytes(bytelist)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/18195">change 18195</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/+/18195"/><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: I8c1e39ccf9fb517d465e73f69c720e7fdde02ded </div>
<div style="display:none"> Gerrit-Change-Number: 18195 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: herlesupreeth <herlesupreeth@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>