mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 14:28: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:
@@ -17,6 +17,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import argparse
|
||||
from typing import Optional
|
||||
|
||||
from smartcard.CardConnection import CardConnection
|
||||
@@ -96,3 +97,9 @@ class PcscSimLink(LinkBase):
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "PCSC:%u[%s]" % (self._reader_number, self._reader)
|
||||
|
||||
@staticmethod
|
||||
def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
|
||||
pcsc_group = arg_parser.add_argument_group('PC/SC Reader')
|
||||
pcsc_group.add_argument('-p', '--pcsc-device', type=int, dest='pcsc_dev', metavar='PCSC', default=None,
|
||||
help='PC/SC reader number to use for SIM access')
|
||||
|
||||
Reference in New Issue
Block a user