[XS] Change in pysim[master]: pySim-shell: let --apdu-trace cover the session
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/43553?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pySim-shell: let --apdu-trace cover the session ...................................................................... pySim-shell: let --apdu-trace cover the session pySim has two APDU tracers: the StdoutApduTracer that --apdu-trace installs in the transport for every program using pySim.transport, and pySim-shell Cmd2ApduTracer for "set apdu_trace true", which prints with cmd2. The command line option exists because the setting applies too late to see the pySim startup APDUs. The guard in init_reader() exists but is useless: if opts.apdu_trace and not 'apdu_tracer' in kwargs: no caller supplies a tracer that way, every tool calls init_reader() without one?. The current help string does not say "trace or maybe not lol" so set the setting from the transport rather than hardcoding False, so the option implies "set apdu_trace true", and it finally works as advertised. Change-Id: I83469e15f4cdd67418cd11df3869f2536105dbc8 --- M pySim-shell.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve dexter: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim-shell.py b/pySim-shell.py index 4f84514..be1d783 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -101,7 +101,7 @@ self.numeric_path = False self.conserve_write = True self.json_pretty_print = True - self.apdu_trace = False + self.apdu_trace = getattr(sl, 'apdu_tracer', None) is not None self.apdu_strict = False self.add_settable(cmd2.Settable('numeric_path', bool, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43553?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I83469e15f4cdd67418cd11df3869f2536105dbc8 Gerrit-Change-Number: 43553 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild@sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org>
participants (1)
-
Hoernchen