[M] Change in pysim[master]: pySim-shell: set callback function to print formatted warnings
Attention is currently required from: dexter, fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: pySim-shell: set callback function to print formatted warnings ...................................................................... pySim-shell: set callback function to print formatted warnings In many sub modules we still use print() to occassionally print status messages or warnings. This technically does not hurt, but it is an unclean solution which we should replace with something more mature. The python provided warnings module provides a warn() function that can be used to send warnings to higher layers. The higher layers can receive the warnings via a callback and then decide what to do with it. In our application we will format and print the warnings using the cmd2 provided functions (or print in case the cmd2 object does not exist yet.) Let's also add a custom warning class "Info", which we can use to print informative messages To illustrate how the approach can be used in sub-modules, this also replaces the print() calls in runtimpe.py with warn() calls. Related: OS#6864 Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb --- M pySim-shell.py M pySim/runtime.py A pySim/warnings.py M tests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok 4 files changed, 56 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/41229/3 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/41229?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb Gerrit-Change-Number: 41229 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy@sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy@sysmocom.de> Gerrit-Attention: dexter <pmaier@sysmocom.de>
participants (1)
-
dexter