laforge has uploaded this change for review.

View Change

edit_{binary,record}_decoded: Support hex-decode of bytes

We've created + used osmocom.utils.JsonEncoder as an encoder class
for json.{dump,dumps} for quite some time. However, we missed to
use this decoder class from the edit_{binary,record}_decoded commands
in the pySim-shell VTY.

Change-Id: I158e028f9920d8085cd20ea022be2437c64ad700
Related: OS#6774
---
M pySim/filesystem.py
1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/19/40119/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 7f350ec..8821380 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -661,7 +661,7 @@
filename = '%s/file' % dirname
# write existing data as JSON to file
with open(filename, 'w') as text_file:
- json.dump(orig_json, text_file, indent=4)
+ json.dump(orig_json, text_file, indent=4, cls=JsonEncoder)
# run a text editor
self._cmd.run_editor(filename)
with open(filename, 'r') as text_file:
@@ -963,7 +963,7 @@
filename = '%s/file' % dirname
# write existing data as JSON to file
with open(filename, 'w') as text_file:
- json.dump(orig_json, text_file, indent=4)
+ json.dump(orig_json, text_file, indent=4, cls=JsonEncoder)
# run a text editor
self._cmd.run_editor(filename)
with open(filename, 'r') as text_file:

To view, visit change 40119. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I158e028f9920d8085cd20ea022be2437c64ad700
Gerrit-Change-Number: 40119
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>