From: <lu...@us...> - 2010-06-09 15:04:19
|
Revision: 465 http://pyscard.svn.sourceforge.net/pyscard/?rev=465&view=rev Author: ludov Date: 2010-06-09 15:04:13 +0000 (Wed, 09 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/CardConnectionObserver.py Modified: trunk/pyscard/src/smartcard/CardConnectionObserver.py =================================================================== --- trunk/pyscard/src/smartcard/CardConnectionObserver.py 2010-06-09 15:01:18 UTC (rev 464) +++ trunk/pyscard/src/smartcard/CardConnectionObserver.py 2010-06-09 15:04:13 UTC (rev 465) @@ -28,14 +28,15 @@ from smartcard.util import toHexString from smartcard.Observer import Observer + # ReaderObserver interface -class CardConnectionObserver( Observer ): +class CardConnectionObserver(Observer): """ CardConnectionObserver is a base class for objects that are to be notified upon CardConnection events. """ - def update( self, cardconnection, cardconnectionevent ): + def update(self, cardconnection, cardconnectionevent): """Called upon CardConnection event. cardconnection: the observed card connection object @@ -44,20 +45,21 @@ pass -class ConsoleCardConnectionObserver( CardConnectionObserver ): - def update( self, cardconnection, ccevent ): +class ConsoleCardConnectionObserver(CardConnectionObserver): - if 'connect'==ccevent.type: + def update(self, cardconnection, ccevent): + + if 'connect' == ccevent.type: print 'connecting to ' + cardconnection.getReader() - elif 'disconnect'==ccevent.type: + elif 'disconnect' == ccevent.type: print 'disconnecting from ' + cardconnection.getReader() - elif 'command'==ccevent.type: - print '> ', toHexString( ccevent.args[0] ) + elif 'command' == ccevent.type: + print '> ', toHexString(ccevent.args[0]) - elif 'response'==ccevent.type: - if []==ccevent.args[0]: + elif 'response' == ccevent.type: + if [] == ccevent.args[0]: print '< [] ', "%-2X %-2X" % tuple(ccevent.args[-2:]) else: print '< ', toHexString(ccevent.args[0]), "%-2X %-2X" % tuple(ccevent.args[-2:]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |