aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2013-07-18 10:36:51 +0200
committerSylvain Munaut <tnt@246tNt.com>2013-07-18 10:36:51 +0200
commit9f13897408c7c58a162e234e57be63034b40773d (patch)
tree63b18b5227e90f22fbf115661b2cccdda80840fe /pySim-read.py
parent7be92ff5d254fb8cedbe83c518cd1ff77543d3dd (diff)
pySim-read: MISDN is not mandatory
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/pySim-read.py b/pySim-read.py
index fac01b0..2c10866 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -124,15 +124,18 @@ if __name__ == '__main__':
print("ACC: Can't read, response code = %s" % (sw,))
# EF.MSISDN
-# print(scc.record_size(['3f00', '7f10', '6f40']))
- (res, sw) = scc.read_record(['3f00', '7f10', '6f40'], 1)
- if sw == '9000':
- if res[1] != 'f':
- print("MSISDN: %s" % (res,))
+ try:
+ # print(scc.record_size(['3f00', '7f10', '6f40']))
+ (res, sw) = scc.read_record(['3f00', '7f10', '6f40'], 1)
+ if sw == '9000':
+ if res[1] != 'f':
+ print("MSISDN: %s" % (res,))
+ else:
+ print("MSISDN: Not available")
else:
- print("MSISDN: Not available")
- else:
- print("MSISDN: Can't read, response code = %s" % (sw,))
+ print("MSISDN: Can't read, response code = %s" % (sw,))
+ except:
+ print "MSISDN: Can't read. Probably not existing file"
# Done for this card and maybe for everything ?
print "Done !\n"