Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41228?usp=email )
Change subject: runtime: check record/file size before write ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File pySim/runtime.py:
https://gerrit.osmocom.org/c/pysim/+/41228/comment/3dce52c3_0b3379db?usp=ema... : PS1, Line 551: I don't think printing is the best option. It probably works, but I think we should use the cmd2 functions for generating output, *iff* we are assuming this code is called from pySim-shell.
I'm not sure the RuntimeLchan nor the RuntimeState have any reference to the cmd_app, and that's probably a good sign of abstraction. Existing code like the select() methods are passing the cmd_app via an optional function argument. This could be used here, too. If the caller passes in cmd_app, then use that to generate output; otherwise fall back to printing.
Another option would be to define something like a "Warning" exception class and raise that from here. The pySim-shell code could then explicitly catch such an excception and print it yellow, rather than going through the normal red exception case?