mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-27 07:48:33 +03:00
transport: Pass argparse.Namespace directly into transport classes
It's odd that the individual transport driver specifies their argparse options but then the core transport part evaluates them individually. This means we cannot add new options within a transport. Let's pass the Namespace instance into the constructor of the specific transport to improve this. Change-Id: Ib977007dd605ec9a9c09a3d143d2c2308991a12c
This commit is contained in:
@@ -38,7 +38,7 @@ class ApduPrintTracer(ApduTracer):
|
||||
pass
|
||||
|
||||
def connect_to_card(slot_nr:int):
|
||||
tp = PcscSimLink(slot_nr, apdu_tracer=ApduPrintTracer())
|
||||
tp = PcscSimLink(argparse.Namespace(pcsc_dev=slot_nr), apdu_tracer=ApduPrintTracer())
|
||||
tp.connect()
|
||||
|
||||
scc = SimCardCommands(tp)
|
||||
|
||||
Reference in New Issue
Block a user