Attention is currently required from: Hoernchen.

dexter has posted comments on this change by Hoernchen. ( 
https://gerrit.osmocom.org/c/pysim/+/43727?usp=email )

Change subject: pySim-shell: verify apdu commands in scripts and -e options up 
front
......................................................................


Patch Set 2: Code-Review+1

(4 comments)

Patchset:

PS2:
I think its a great idea to implement some validation before we do things. This 
might prevent a lot of damage and inconsistent state.

I haven't fully looked through yet, but my first impression is that the patch 
looks good. I have left a few cosmetic comments. Unfortunately I have trouble 
trying it out. As it seems the patch as compatibility issues with some Cmd2 
versions?


File pySim-shell.py:

https://gerrit.osmocom.org/c/pysim/+/43727/comment/a582266d_6e27e9cb?usp=email :
PS2, Line 1112: def verify_startup_apdus(commands: List[tuple]) -> List[str]:
maybe call it "verify_apdu_commands"? Technically this utility function could 
not only be useful to validate APDU commands and scripts that are supplied on 
startup. In fact it could also be very useful to call it from other locations 
as well. The bulk_script command for example.


https://gerrit.osmocom.org/c/pysim/+/43727/comment/052b22ff_909a48f4?usp=email :
PS2, Line 1130:     run_script_parser = cmd2.Cmd._build_run_script_parser()
Hmm, when I want to try it, I get this error message:

```
$ ./pySim-shell.py -p 0
Traceback (most recent call last):
  File "/home/user/work/git_master/pysim/./pySim-shell.py", line 1239, in 
<module>
    findings = verify_startup_apdus(startup_commands)
  File "/home/user/work/git_master/pysim/./pySim-shell.py", line 1130, in 
verify_startup_apdus
    run_script_parser = cmd2.Cmd._build_run_script_parser()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Cmd' has no attribute '_build_run_script_parser'. 
Did you mean: 'relative_run_script_parser'?

```

I have cmd2 2.7.0 installed.


https://gerrit.osmocom.org/c/pysim/+/43727/comment/27fda88a_38507f18?usp=email :
PS2, Line 1148:     def check_line(loc: str, line: str, script_dir: str):
I recommend to move this function below check_script, because this is the first 
and only function the for loop calls. The functions would then be in order.



--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43727?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ida84b982d7577faa5b37f121599a59bcb2feefec
Gerrit-Change-Number: 43727
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Attention: Hoernchen <[email protected]>
Gerrit-Comment-Date: Thu, 19 Nov 2026 10:35:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Reply via email to