Attention is currently required from: laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42741?usp=email )
Change subject: pySim/global_platform: make functionality available outside of cmd2 ......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
I don't really like the approach to expose lots of functions at the module that are not part of some […]
I am also not so convinced with the current approach. We need to find something that allows us to decouple the business logic (global platform, lchan, etc.) from the user interface (cmd2)
My first idea would be to have an abstract base class that accepts an lchan via its constructor. The lchan, can then be accessed by methods implemented by a specific class. With such a base class we could implement all kinds of utility classes. And it would be a simple scheme.
I have also tried to explore an alternative where we would separate the nested AddlShellCommands from the ADF_SD class. I thought we then could keep the business logic method (the ones we have currently split aside) inside ADF_SD to access them from the AddlShellCommands, which is now outside. Unfortunately this quickly becomes a mess since the lchan object is somewhere in the _cmd object and that only exists in AddlShellCommands. We could pass a reference to the ADF_SD object and access the methods by passing the lchan object from the AddlShellCommands object, but that would be also not a clean solution. I think removing the dependency to cmd2 on that level is very complicated.
Which path do you think we should take?