mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 14:28:32 +03:00
pySim/profile: Change match_with_profile from static to class method
This was suggested by vyanitskiy during gerrit patch review in https://gerrit.osmocom.org/c/pysim/+/38049 in order to make the upcoming eUICC CardProfiles simpler. Change-Id: Ia7c049b31cb1c5c5bb682406d9dd7a73bcd43185
This commit is contained in:
@@ -190,8 +190,8 @@ class CardProfileRUIM(CardProfile):
|
|||||||
# TODO: Response parameters/data in case of DF_CDMA (section 2.6)
|
# TODO: Response parameters/data in case of DF_CDMA (section 2.6)
|
||||||
return CardProfileSIM.decode_select_response(data_hex)
|
return CardProfileSIM.decode_select_response(data_hex)
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def match_with_card(scc: SimCardCommands) -> bool:
|
def match_with_card(cls, scc: SimCardCommands) -> bool:
|
||||||
return match_ruim(scc)
|
return match_ruim(scc)
|
||||||
|
|
||||||
class AddonRUIM(CardProfileAddon):
|
class AddonRUIM(CardProfileAddon):
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ class CardProfile:
|
|||||||
"""
|
"""
|
||||||
return data_hex
|
return data_hex
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def match_with_card(scc: SimCardCommands) -> bool:
|
def match_with_card(cls, scc: SimCardCommands) -> bool:
|
||||||
"""Check if the specific profile matches the card. This method is a
|
"""Check if the specific profile matches the card. This method is a
|
||||||
placeholder that is overloaded by specific dirived classes. The method
|
placeholder that is overloaded by specific dirived classes. The method
|
||||||
actively probes the card to make sure the profile class matches the
|
actively probes the card to make sure the profile class matches the
|
||||||
|
|||||||
@@ -884,8 +884,8 @@ class CardProfileUICC(CardProfile):
|
|||||||
d = t.to_dict()
|
d = t.to_dict()
|
||||||
return flatten_dict_lists(d['fcp_template'])
|
return flatten_dict_lists(d['fcp_template'])
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def match_with_card(scc: SimCardCommands) -> bool:
|
def match_with_card(cls, scc: SimCardCommands) -> bool:
|
||||||
return match_uicc(scc)
|
return match_uicc(scc)
|
||||||
|
|
||||||
@with_default_category('TS 102 221 Specific Commands')
|
@with_default_category('TS 102 221 Specific Commands')
|
||||||
|
|||||||
@@ -1192,8 +1192,8 @@ class CardProfileSIM(CardProfile):
|
|||||||
ret['life_cycle_status_int'] = 'terminated'
|
ret['life_cycle_status_int'] = 'terminated'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def match_with_card(scc: SimCardCommands) -> bool:
|
def match_with_card(cls, scc: SimCardCommands) -> bool:
|
||||||
return match_sim(scc)
|
return match_sim(scc)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user