forked from public/pysim
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:
@@ -77,7 +77,8 @@ class L1CTLMessageSIM(L1CTLMessage):
|
||||
class CalypsoSimLink(LinkBase):
|
||||
"""Transport Link for Calypso based phones."""
|
||||
|
||||
def __init__(self, sock_path: str = "/tmp/osmocom_l2", **kwargs):
|
||||
def __init__(self, opts: argparse.Namespace = argparse.Namespace(osmocon_sock="/tmp/osmocom_l2"), **kwargs):
|
||||
sock_path = opts.osmocon_sock
|
||||
super().__init__(**kwargs)
|
||||
if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
|
||||
print("Using Calypso-based (OsmocomBB) reader interface")
|
||||
|
||||
Reference in New Issue
Block a user