mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-31 01:23:31 +03:00
Python is not C: get rid of unnecessary semicolons
See https://www.python.org/dev/peps/pep-0008/. Change-Id: I9de3bcd324b0a1b98af761678996eaae85f7f790 Related: OS#5292
This commit is contained in:
@@ -72,15 +72,15 @@ def init_card(sl):
|
|||||||
sl.wait_for_card(3)
|
sl.wait_for_card(3)
|
||||||
except NoCardError:
|
except NoCardError:
|
||||||
print("No card detected!")
|
print("No card detected!")
|
||||||
return None, None;
|
return None, None
|
||||||
except:
|
except:
|
||||||
print("Card not readable!")
|
print("Card not readable!")
|
||||||
return None, None;
|
return None, None
|
||||||
|
|
||||||
card = card_detect("auto", scc)
|
card = card_detect("auto", scc)
|
||||||
if card is None:
|
if card is None:
|
||||||
print("Could not detect card type!")
|
print("Could not detect card type!")
|
||||||
return None, None;
|
return None, None
|
||||||
|
|
||||||
# Create runtime state with card profile
|
# Create runtime state with card profile
|
||||||
profile = CardProfileUICC()
|
profile = CardProfileUICC()
|
||||||
@@ -207,7 +207,7 @@ class PysimApp(cmd2.Cmd):
|
|||||||
@cmd2.with_category(CUSTOM_CATEGORY)
|
@cmd2.with_category(CUSTOM_CATEGORY)
|
||||||
def do_equip(self, opts):
|
def do_equip(self, opts):
|
||||||
"""Equip pySim-shell with card"""
|
"""Equip pySim-shell with card"""
|
||||||
rs, card = init_card(sl);
|
rs, card = init_card(sl)
|
||||||
self.equip(card, rs)
|
self.equip(card, rs)
|
||||||
|
|
||||||
class InterceptStderr(list):
|
class InterceptStderr(list):
|
||||||
@@ -352,7 +352,7 @@ class PysimApp(cmd2.Cmd):
|
|||||||
except (KeyboardInterrupt):
|
except (KeyboardInterrupt):
|
||||||
self.poutput("")
|
self.poutput("")
|
||||||
self.poutput("Terminated by user!")
|
self.poutput("Terminated by user!")
|
||||||
return;
|
return
|
||||||
except (SystemExit):
|
except (SystemExit):
|
||||||
# When all cards are processed the card handler device will throw a SystemExit
|
# When all cards are processed the card handler device will throw a SystemExit
|
||||||
# exception. Also Errors that are not recoverable (cards stuck etc.) will end up here.
|
# exception. Also Errors that are not recoverable (cards stuck etc.) will end up here.
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ def comprehensiontlv_encode_tag(tag) -> bytes:
|
|||||||
compr = tag.get('comprehension', False)
|
compr = tag.get('comprehension', False)
|
||||||
if tag['tag'] in [0x00, 0x80, 0xff] or tag['tag'] > 0xff:
|
if tag['tag'] in [0x00, 0x80, 0xff] or tag['tag'] > 0xff:
|
||||||
# 3-byte format
|
# 3-byte format
|
||||||
byte3 = tag['tag'] & 0xff;
|
byte3 = tag['tag'] & 0xff
|
||||||
byte2 = (tag['tag'] >> 8) & 0x7f
|
byte2 = (tag['tag'] >> 8) & 0x7f
|
||||||
if compr:
|
if compr:
|
||||||
byte2 |= 0x80
|
byte2 |= 0x80
|
||||||
@@ -243,7 +243,7 @@ def bertlv_encode_tag(t) -> bytes:
|
|||||||
t |= (cls & 3) << 6
|
t |= (cls & 3) << 6
|
||||||
return bytes([t])
|
return bytes([t])
|
||||||
else: # multi-byte tag
|
else: # multi-byte tag
|
||||||
t = 0x1f;
|
t = 0x1f
|
||||||
if constructed:
|
if constructed:
|
||||||
t |= 0x20
|
t |= 0x20
|
||||||
t |= (cls & 3) << 6
|
t |= (cls & 3) << 6
|
||||||
|
|||||||
Reference in New Issue
Block a user