From 58e89eb15a9260104c03d4285920c1d190fc9b80 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 10 Oct 2023 11:59:03 +0200 Subject: [PATCH] transport: add return type annotation to method __str__ The abstract class LinkBase has no return type annotation on its __str__ method. Related: OS#6210 Change-Id: I26d3d2714708dbe957704b60d17ba2afa325b2c4 --- pySim/transport/__init__.py | 2 +- pySim/transport/calypso.py | 2 +- pySim/transport/modem_atcmd.py | 2 +- pySim/transport/pcsc.py | 2 +- pySim/transport/serial.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 1dd8d18c..0b50a4f8 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -68,7 +68,7 @@ class LinkBase(abc.ABC): self.proactive_handler = proactive_handler @abc.abstractmethod - def __str__(self): + def __str__(self) -> str: """Implementation specific method for printing an information to identify the device.""" @abc.abstractmethod diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py index b827d88c..d7d9649c 100644 --- a/pySim/transport/calypso.py +++ b/pySim/transport/calypso.py @@ -160,5 +160,5 @@ class CalypsoSimLink(LinkBase): return b2h(data), b2h(sw) - def __str__(self): + def __str__(self) -> str: return "osmocon:%s" % (self._sock_path) diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py index 58d6f9d1..5e5a3dd6 100644 --- a/pySim/transport/modem_atcmd.py +++ b/pySim/transport/modem_atcmd.py @@ -170,5 +170,5 @@ class ModemATCommandLink(LinkBase): log.debug('Command response: %s, %s', data, sw) return data, sw - def __str__(self): + def __str__(self) -> str: return "modem:%s" % self._device diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index 41c4c190..c7b58786 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -93,5 +93,5 @@ class PcscSimLink(LinkBase): # Return value return i2h(data), i2h(sw) - def __str__(self): + def __str__(self) -> str: return "PCSC:%u[%s]" % (self._reader_number, self._reader) diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index f4b1621e..e5f7bdb9 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -237,5 +237,5 @@ class SerialSimLink(LinkBase): # Return value return b2h(data), b2h(sw) - def __str__(self): + def __str__(self) -> str: return "serial:%s" % (self._sl.name)