forked from public/pysim
pySim.apdu: Refactor cmd_to_dict() method
Let's factor out the "automatic processing using _tlv / _construct" as a separate method. This way we enable a derived class to first call that automatic processing method, and then amend its output in a second step. Change-Id: I1f066c0f1502020c88d99026c25bf2e283c3b4f5
This commit is contained in:
@@ -292,6 +292,10 @@ class ApduCommand(Apdu, metaclass=ApduCommandMeta):
|
||||
if callable(method):
|
||||
return method()
|
||||
else:
|
||||
return self._cmd_to_dict()
|
||||
|
||||
def _cmd_to_dict(self) -> Dict:
|
||||
"""back-end function performing automatic decoding using _construct / _tlv."""
|
||||
r = {}
|
||||
method = getattr(self, '_decode_p1p2', None)
|
||||
if callable(method):
|
||||
|
||||
Reference in New Issue
Block a user