mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-17 02:48:34 +03:00
transport: Move printing of reader number/name to generic code
Let's avoid copy+pasting print statements everywhere. The instances do already have a __str__ method for the purpose of printing their name in a generic way. Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
""" pySim: PCSC reader transport link base
|
||||
"""
|
||||
|
||||
import os
|
||||
import abc
|
||||
import argparse
|
||||
from typing import Optional, Tuple
|
||||
@@ -300,4 +301,10 @@ def init_reader(opts, **kwargs) -> LinkBase:
|
||||
print("No reader/driver specified; falling back to default (Serial reader)")
|
||||
from pySim.transport.serial import SerialSimLink
|
||||
sl = SerialSimLink(opts, **kwargs)
|
||||
|
||||
if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
|
||||
print("Using %s reader interface" % (sl.name))
|
||||
else:
|
||||
print("Using reader %s" % sl)
|
||||
|
||||
return sl
|
||||
|
||||
Reference in New Issue
Block a user