Package smartcard :: Module CardConnectionDecorator
[hide private]
[frames] | no frames]

Source Code for Module smartcard.CardConnectionDecorator

 1  """The CardConnectionDecorator is a Decorator around the CardConnection 
 2  abstract class, and allows dynamic addition of features to the 
 3  CardConnection, e.g. implementing a secure channel.. 
 4   
 5  __author__ = "http://www.gemalto.com" 
 6   
 7  Copyright 2001-2012 gemalto 
 8  Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com 
 9   
10  This file is part of pyscard. 
11   
12  pyscard is free software; you can redistribute it and/or modify 
13  it under the terms of the GNU Lesser General Public License as published by 
14  the Free Software Foundation; either version 2.1 of the License, or 
15  (at your option) any later version. 
16   
17  pyscard is distributed in the hope that it will be useful, 
18  but WITHOUT ANY WARRANTY; without even the implied warranty of 
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
20  GNU Lesser General Public License for more details. 
21   
22  You should have received a copy of the GNU Lesser General Public License 
23  along with pyscard; if not, write to the Free Software 
24  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
25  """ 
26   
27  from smartcard.CardConnection import CardConnection 
28   
29   
30 -class CardConnectionDecorator(CardConnection):
31 """Card connection decorator class.""" 32
33 - def __init__(self, cardConnectionComponent):
34 """Construct a new card connection decorator. 35 36 CardConnectionComponent: CardConnection component to decorate 37 """ 38 self.component = cardConnectionComponent
39
40 - def addSWExceptionToFilter(self, exClass):
41 """call inner component addSWExceptionToFilter""" 42 self.component.addSWExceptionToFilter(exClass)
43
44 - def addObserver(self, observer):
45 """call inner component addObserver""" 46 self.component.addObserver(observer)
47
48 - def deleteObserver(self, observer):
49 """call inner component deleteObserver""" 50 self.component.deleteObserver(observer)
51
52 - def connect(self, protocol=None, mode=None, disposition=None):
53 """call inner component connect""" 54 self.component.connect(protocol, mode, disposition)
55
56 - def disconnect(self):
57 """call inner component disconnect""" 58 self.component.disconnect()
59
60 - def getATR(self):
61 """call inner component getATR""" 62 return self.component.getATR()
63
64 - def getProtocol(self):
65 """call inner component getProtocol""" 66 return self.component.getProtocol()
67
68 - def getReader(self):
69 """call inner component getReader""" 70 return self.component.getReader()
71
72 - def setErrorCheckingChain(self, errorcheckingchain):
73 """call inner component setErrorCheckingChain""" 74 self.component.setErrorCheckingChain(errorcheckingchain)
75
76 - def setProtocol(self, protocol):
77 """call inner component setProtocol""" 78 return self.component.setProtocol(protocol)
79
80 - def transmit(self, bytes, protocol=None):
81 """call inner component transmit""" 82 return self.component.transmit(bytes, protocol)
83
84 - def control(self, controlCode, bytes=[]):
85 """call inner component control""" 86 return self.component.control(controlCode, bytes)
87
88 - def getAttrib(self, attribId):
89 """call inner component getAttrib""" 90 return self.component.getAttrib(attribId)
91