cosmetic: use **kwargs instead of **_kwargs
Some methods sometimes have a **_kwargs parameter, let's be consistent and use **kwargs only. Related: OS#5714 Change-Id: I98857cc774185e55a604eb4fbfbf62ed4bd6ded7
This commit is contained in:
@@ -733,7 +733,7 @@ class EF_ARR(LinFixedEF):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
return by_mode
|
return by_mode
|
||||||
|
|
||||||
def _decode_record_bin(self, raw_bin_data, **_kwargs):
|
def _decode_record_bin(self, raw_bin_data, **kwargs):
|
||||||
# we can only guess if we should decode for EF or DF here :(
|
# we can only guess if we should decode for EF or DF here :(
|
||||||
arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
|
arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
|
||||||
dec = arr_seq.decode_multi(raw_bin_data)
|
dec = arr_seq.decode_multi(raw_bin_data)
|
||||||
@@ -741,7 +741,7 @@ class EF_ARR(LinFixedEF):
|
|||||||
# 'un-flattening' decoder, and hence would be unable to encode :(
|
# 'un-flattening' decoder, and hence would be unable to encode :(
|
||||||
return dec[0]
|
return dec[0]
|
||||||
|
|
||||||
def _encode_record_bin(self, in_json, **_kwargs):
|
def _encode_record_bin(self, in_json, **kwargs):
|
||||||
# we can only guess if we should decode for EF or DF here :(
|
# we can only guess if we should decode for EF or DF here :(
|
||||||
arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
|
arr_seq = DataObjectSequence('arr', sequence=[AM_DO_EF, SC_DO])
|
||||||
return arr_seq.encode_multi(in_json)
|
return arr_seq.encode_multi(in_json)
|
||||||
|
|||||||
@@ -405,14 +405,14 @@ class EF_LI(TransRecEF):
|
|||||||
desc='Language Indication'):
|
desc='Language Indication'):
|
||||||
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len)
|
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len)
|
||||||
|
|
||||||
def _decode_record_bin(self, in_bin, **_kwargs):
|
def _decode_record_bin(self, in_bin, **kwargs):
|
||||||
if in_bin == b'\xff\xff':
|
if in_bin == b'\xff\xff':
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
# officially this is 7-bit GSM alphabet with one padding bit in each byte
|
# officially this is 7-bit GSM alphabet with one padding bit in each byte
|
||||||
return in_bin.decode('ascii')
|
return in_bin.decode('ascii')
|
||||||
|
|
||||||
def _encode_record_bin(self, in_json, **_kwargs):
|
def _encode_record_bin(self, in_json, **kwargs):
|
||||||
if in_json is None:
|
if in_json is None:
|
||||||
return b'\xff\xff'
|
return b'\xff\xff'
|
||||||
else:
|
else:
|
||||||
@@ -505,7 +505,7 @@ class EF_ECC(LinFixedEF):
|
|||||||
desc='Emergency Call Codes'):
|
desc='Emergency Call Codes'):
|
||||||
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(4, 20))
|
super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(4, 20))
|
||||||
|
|
||||||
def _decode_record_bin(self, in_bin, **_kwargs):
|
def _decode_record_bin(self, in_bin, **kwargs):
|
||||||
# mandatory parts
|
# mandatory parts
|
||||||
code = in_bin[:3]
|
code = in_bin[:3]
|
||||||
if code == b'\xff\xff\xff':
|
if code == b'\xff\xff\xff':
|
||||||
@@ -519,7 +519,7 @@ class EF_ECC(LinFixedEF):
|
|||||||
ret['alpha_id'] = parse_construct(EF_ECC.alpha_construct, alpha_id)
|
ret['alpha_id'] = parse_construct(EF_ECC.alpha_construct, alpha_id)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def _encode_record_bin(self, in_json, **_kwargs):
|
def _encode_record_bin(self, in_json, **kwargs):
|
||||||
if in_json is None:
|
if in_json is None:
|
||||||
return b'\xff\xff\xff\xff'
|
return b'\xff\xff\xff\xff'
|
||||||
code = EF_ECC.cc_construct.build(in_json['call_code'])
|
code = EF_ECC.cc_construct.build(in_json['call_code'])
|
||||||
@@ -682,7 +682,7 @@ class EF_RPLMNAcT(TransRecEF):
|
|||||||
def __init__(self, fid='6f65', sfid=None, name='EF.RPLMNAcTD', size=(2, 4), rec_len=2,
|
def __init__(self, fid='6f65', sfid=None, name='EF.RPLMNAcTD', size=(2, 4), rec_len=2,
|
||||||
desc='RPLMN Last used Access Technology', **kwargs):
|
desc='RPLMN Last used Access Technology', **kwargs):
|
||||||
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs)
|
super().__init__(fid, sfid=sfid, name=name, desc=desc, size=size, rec_len=rec_len, **kwargs)
|
||||||
def _decode_record_hex(self, in_hex, **_kwargs):
|
def _decode_record_hex(self, in_hex, **kwargs):
|
||||||
return dec_act(in_hex)
|
return dec_act(in_hex)
|
||||||
# TODO: Encode
|
# TODO: Encode
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user