Attention is currently required from: laforge, pespin.
Patch set 2:Code-Review -1
1 comment:
File pySim/ts_51_011.py:
Patch Set #2, Line 366: 'dialing_nr'/ExtendedBcdAdapter(BcdAdapter(Rpad(Bytes(10)))),
yes, the ExtendedBcdAdapter is written in a way that it just translates the */# characters, and in o […]
But then it's not really a BcdAdapter, if it simply translates the */# characters? I don't want to block your work, but currently it looks cumbersome and confusing. Here is my proposal:
class ExtendedBcdAdapter(BcdAdapter):
"""convert a bytes() type to a string of BCD nibbles, replacing a/b with */# """
def _decode(self, obj, context, path):
obj = obj.lower().replace("a","*").replace("b","#")
return super()._decode(obj, context, path)
def _encode(self, obj, context, path):
obj = obj.replace("*","a").replace("#","b")
return super()._encode(obj, context, path)
With this implementation it can be used directly.
To view, visit change 31066. To unsubscribe, or for help writing mail filters, visit settings.