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
Method Details [hide private]

__init__(self, chain, strategy)
(Constructor)

source code 

constructor. Appends a strategy to the ErrorCheckingChain chain.

addFilterException(self, exClass)

source code 

Add an exception filter to the error checking chain.

Parameters: