From 48e1b90eb883c5a124c8475298ff4344ec9e6623 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 17 Sep 2021 13:22:32 +0200 Subject: [PATCH] card_handler: make reader (sl) operations optional. The constructor gets an sl object on initalization. The card handler will then carry out the reader operation wait_for_card(). In cases where an mechanically automated card reader is used it may be useful to go without those operations and let the caller carry out the appropriate reader operations. So Lets make the sl object optional for the CardHandlerAuto class. If it is not present, simply do not carry out the pre programmed reader operation. Change-Id: I0f793aec51751b7c7b87d55b66326cce9970274e Related: SYS#5617 --- pySim/card_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pySim/card_handler.py b/pySim/card_handler.py index ef1b0713..385c55e2 100644 --- a/pySim/card_handler.py +++ b/pySim/card_handler.py @@ -94,7 +94,8 @@ class CardHandlerAuto: def get(self, first = False): print("Ready for Programming: Transporting card into the reader-bay...") self.__exec_cmd(self.cmds['get']) - self.sl.connect() + if self.sl: + self.sl.connect() def error(self): print("Programming failed: Transporting card to the error-bin...")