aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-05-12 16:47:45 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2020-05-22 14:43:15 +0200
commitd58c632277d64cad63e8e426be69ec1a4347f8ef (patch)
tree13bad2b5229d8463a4352bc91c560a74e2cf8a4f
parent5c2cc66de5fcf354616c6d3bb024d17bf8075a69 (diff)
cards: remove empty erase() methods.
Some of the cards do not implement the erase method that each card should have. However, having an empty method in each of those classes does not make too much sense. Lets rather have an erase method in the superclass (Card) that prints a warning to inform the user that erasing the spcified card is not supported. Change-Id: If5add960ec0cab58a01d8f83e6af8cb86ec70a8d
-rw-r--r--pySim/cards.py24
1 files changed, 4 insertions, 20 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index 73b0763..c7b34eb 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -37,6 +37,10 @@ class Card(object):
def reset(self):
self._scc.reset_card()
+ def erase(self):
+ print("warning: erasing is not supported for specified card type!")
+ return
+
def verify_adm(self, key):
'''
Authenticate with ADM key
@@ -529,8 +533,6 @@ class GrcardSim(Card):
# FIXME: EF.MSISDN
- def erase(self):
- return
class SysmoSIMgr1(GrcardSim):
"""
@@ -575,9 +577,6 @@ class SysmoUSIMgr1(Card):
)
data, sw = self._scc._tp.send_apdu_checksw("0099000033" + par)
- def erase(self):
- return
-
class SysmoSIMgr2(Card):
"""
@@ -653,8 +652,6 @@ class SysmoSIMgr2(Card):
if p.get('smsp'):
data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 80))
- def erase(self):
- return
class SysmoUSIMSJS1(Card):
"""
@@ -759,9 +756,6 @@ class SysmoUSIMSJS1(Card):
r = self._scc.select_file(['3f00', '7f10'])
data, sw = self._scc.update_record('6F40', 1, data, force_len=True)
- def erase(self):
- return
-
class FairwavesSIM(Card):
"""
@@ -903,10 +897,6 @@ class FairwavesSIM(Card):
if sw != '9000':
print("Programming ACC failed with code %s"%sw)
- def erase(self):
- return
-
-
class OpenCellsSim(Card):
"""
OpenCellsSim
@@ -1046,9 +1036,6 @@ class WavemobileSim(Card):
return None
- def erase(self):
- return
-
class SysmoISIMSJA2(Card):
"""
@@ -1169,9 +1156,6 @@ class SysmoISIMSJA2(Card):
return
- def erase(self):
- return
-
# In order for autodetection ...
_cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim,