smartcard.sw.ErrorCheckingChain.ErrorCheckingChain

# ``smartcard`.`sw`.`ErrorCheckingChain`.`ErrorCheckingChain``

class documentation

`class ErrorCheckingChain(object):`

View In Hierarchy

The error checking chain is a list of response apdu status word (sw1, sw2) error check strategies. Each strategy in the chain is called until an error is detected. A `smartcard.sw.SWExceptions` exception is raised when an error is detected. No exception is raised if no error is detected.

Implementation derived from Bruce Eckel, Thinking in Python. The `ErrorCheckingChain` implements the Chain Of Responsibility design pattern.

Method | `__call__` | Called to test data, sw1 and sw2 for error on the chain.
Method | `__init__` | constructor. Appends a strategy to the `ErrorCheckingChain` chain.
Method | `addFilterException` | Add an exception filter to the error checking chain.
Method | `end` | Returns True if this is the end of the error checking strategy chain.
Method | `next` | Returns next error checking strategy.
Instance Variable | `chain` | Undocumented
Instance Variable | `excludes` | Undocumented
Instance Variable | `strategy` | Undocumented

def __call__(self, data, sw1, sw2):

Called to test data, sw1 and sw2 for error on the chain.

def __init__(self, chain, strategy):

constructor. Appends a strategy to the `ErrorCheckingChain` chain.

def addFilterException(self, exClass):

Add an exception filter to the error checking chain.

Parameters
exClass | the exception to exclude, e.g. `smartcard.sw.SWExceptions.WarningProcessingException` A filtered exception will not be raised when the sw1,sw2 conditions that would raise the excption are met.

def end(self):

Returns True if this is the end of the error checking strategy chain.

def next(self):

Returns next error checking strategy.

chain =

Undocumented

excludes: `list` =

Undocumented

strategy =

Undocumented