Attention is currently required from: Hoernchen.
Patch set 2:Code-Review +1
4 comments:
Patchset:
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:
Patch Set #2, 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.
Patch Set #2, 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.
Patch Set #2, 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 change 43727. To unsubscribe, or for help writing mail filters, visit settings.