Change in pysim[master]: [pylint] Declare abstract LinkBase._send_apdu_raw() method as such

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun May 2 20:22:18 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/24031 )

Change subject: [pylint] Declare abstract LinkBase._send_apdu_raw() method as such
......................................................................

[pylint] Declare abstract LinkBase._send_apdu_raw() method as such

pySim/transport/__init__.py:86:15: E1101:
	Instance of 'LinkBase' has no '_send_apdu_raw' member;
	maybe 'send_apdu_raw'? (no-member)

Change-Id: I14fcdceca5d1e35491b6ad98f96b4276b69b2fc1
---
M pySim/transport/__init__.py
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index d4f7f3a..05edc98 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -3,8 +3,9 @@
 """ pySim: PCSC reader transport link base
 """
 
+import abc
 import argparse
-from typing import Optional
+from typing import Optional, Tuple
 
 from pySim.exceptions import *
 from pySim.construct import filter_dict
@@ -36,13 +37,17 @@
 		pass
 
 
-class LinkBase(object):
+class LinkBase(abc.ABC):
 	"""Base class for link/transport to card."""
 
 	def __init__(self, sw_interpreter=None, apdu_tracer=None):
 		self.sw_interpreter = sw_interpreter
 		self.apdu_tracer = apdu_tracer
 
+	@abc.abstractmethod
+	def _send_apdu_raw(self, pdu:str) -> Tuple[str, str]:
+		"""Implementation specific method for sending the PDU."""
+
 	def set_sw_interpreter(self, interp):
 		"""Set an (optional) status word interpreter."""
 		self.sw_interpreter = interp

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/24031
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I14fcdceca5d1e35491b6ad98f96b4276b69b2fc1
Gerrit-Change-Number: 24031
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210502/c2584404/attachment.htm>


More information about the gerrit-log mailing list