Package smartcard :: Package sw :: Module ErrorCheckingChain :: Class ErrorCheckingChain
[hide private]
[frames] | no frames]

Class ErrorCheckingChain

source code


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.SWException 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.

Instance Methods [hide private]
 
__init__(self, chain, strategy)
constructor.
source code
 
next(self)
Returns next error checking strategy.
source code
 
addFilterException(self, exClass)
Add an exception filter to the error checking chain.
source code
 
end(self)
Returns True if this is the end of the error checking strategy chain.
source code
 
__call__(self, data, sw1, sw2)
Called to test data, sw1 and sw2 for error on the chain.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, chain, strategy)
(Constructor)

source code 

constructor. Appends a strategy to the ErrorCheckingChain chain.

Overrides: object.__init__

addFilterException(self, exClass)

source code 

Add an exception filter to the error checking chain.

Parameters: