mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 14:58:33 +03:00
transport: print reader device/number on init
When we initialize the reader, we currently tell only which type of interface we are using, but we do not print the reader number or the device path. Let's extend the messages so that the path is printed. To prevent problems with integration-tests, let's also add an environment variable that we can use to detect when pySim runs inside a integration-test. Related: OS#6210 Change-Id: Ibe296d51885b1ef5f9c9ecaf1d28da52014dcc4b
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#
|
||||
|
||||
import argparse
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
from smartcard.CardConnection import CardConnection
|
||||
@@ -35,7 +36,10 @@ class PcscSimLink(LinkBase):
|
||||
|
||||
def __init__(self, reader_number: int = 0, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
print("Using PC/SC reader interface")
|
||||
if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
|
||||
print("Using PC/SC reader interface")
|
||||
else:
|
||||
print("Using PC/SC reader number %u" % reader_number)
|
||||
r = readers()
|
||||
if reader_number >= len(r):
|
||||
raise ReaderError('No reader found for number %d' % reader_number)
|
||||
|
||||
Reference in New Issue
Block a user