mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
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
This commit is contained in:
@@ -661,7 +661,7 @@ class TransparentEF(CardEF):
|
|||||||
filename = '%s/file' % dirname
|
filename = '%s/file' % dirname
|
||||||
# write existing data as JSON to file
|
# write existing data as JSON to file
|
||||||
with open(filename, 'w') as text_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
|
# run a text editor
|
||||||
self._cmd.run_editor(filename)
|
self._cmd.run_editor(filename)
|
||||||
with open(filename, 'r') as text_file:
|
with open(filename, 'r') as text_file:
|
||||||
@@ -963,7 +963,7 @@ class LinFixedEF(CardEF):
|
|||||||
filename = '%s/file' % dirname
|
filename = '%s/file' % dirname
|
||||||
# write existing data as JSON to file
|
# write existing data as JSON to file
|
||||||
with open(filename, 'w') as text_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
|
# run a text editor
|
||||||
self._cmd.run_editor(filename)
|
self._cmd.run_editor(filename)
|
||||||
with open(filename, 'r') as text_file:
|
with open(filename, 'r') as text_file:
|
||||||
|
|||||||
Reference in New Issue
Block a user