Attention is currently required from: dexter.
Patch set 1:Code-Review +1
1 comment:
File pySim/runtime.py:
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?
To view, visit change 41228. To unsubscribe, or for help writing mail filters, visit settings.