mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 23:38:32 +03:00
transport: move argument parser setup into concrete classes
The argument parser is set up globally for all LinkBase objects in __init__.py. Since we tend to have only platform independed code in __init__.py, we should move the argument parser setup into the specific LinkBase classes. Related: OS#6210 Change-Id: I22c32aa81ca0588e3314c3ff4546f6e5092c11df
This commit is contained in:
@@ -20,7 +20,7 @@ import select
|
||||
import struct
|
||||
import socket
|
||||
import os
|
||||
|
||||
import argparse
|
||||
from typing import Optional
|
||||
|
||||
from pySim.transport import LinkBase
|
||||
@@ -164,3 +164,9 @@ class CalypsoSimLink(LinkBase):
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "osmocon:%s" % (self._sock_path)
|
||||
|
||||
@staticmethod
|
||||
def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
|
||||
osmobb_group = arg_parser.add_argument_group('OsmocomBB Reader')
|
||||
osmobb_group.add_argument('--osmocon', dest='osmocon_sock', metavar='PATH', default=None,
|
||||
help='Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)')
|
||||
|
||||
Reference in New Issue
Block a user