You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(10) |
Feb
(10) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(9) |
Oct
(10) |
Nov
(2) |
Dec
(5) |
2009 |
Jan
(17) |
Feb
(8) |
Mar
(10) |
Apr
(1) |
May
|
Jun
(11) |
Jul
(18) |
Aug
|
Sep
|
Oct
(10) |
Nov
(40) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
(5) |
Mar
(13) |
Apr
(14) |
May
(27) |
Jun
(86) |
Jul
(1) |
Aug
(12) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(5) |
2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(11) |
Aug
(1) |
Sep
(3) |
Oct
(65) |
Nov
|
Dec
(1) |
2012 |
Jan
(1) |
Feb
(4) |
Mar
(6) |
Apr
(6) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(12) |
Oct
(3) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(1) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(24) |
Dec
(10) |
2015 |
Jan
(1) |
Feb
(10) |
Mar
|
Apr
|
May
(1) |
Jun
(15) |
Jul
(4) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <lu...@us...> - 2010-06-06 15:20:20
|
Revision: 430 http://pyscard.svn.sourceforge.net/pyscard/?rev=430&view=rev Author: ludov Date: 2010-06-06 15:20:14 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py 2010-06-06 15:18:10 UTC (rev 429) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py 2010-06-06 15:20:14 UTC (rev 430) @@ -26,6 +26,7 @@ from smartcard.reader.ReaderGroups import readergroups, innerreadergroups from smartcard.pcsc.PCSCExceptions import * + class pcscinnerreadergroups(innerreadergroups): """Smartcard PCSC readers groups inner class. @@ -33,78 +34,79 @@ instance of this class. """ - - def __init__(self, initlist=None ): + def __init__(self, initlist=None): """Constructor.""" - innerreadergroups.__init__(self, initlist ) - self.unremovablegroups=['SCard$DefaultReaders'] + innerreadergroups.__init__(self, initlist) + self.unremovablegroups = ['SCard$DefaultReaders'] - - def getreadergroups( self ): + def getreadergroups(self): """ Returns the list of smartcard reader groups. import smartcard print smartcard.reader_groups() """ - innerreadergroups.getreadergroups( self ) + innerreadergroups.getreadergroups(self) - hresult, hcontext=SCardEstablishContext( SCARD_SCOPE_USER ) + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult!=0: - raise EstablishContextException( hresult ) - hresult, readers = SCardListReaderGroups( hcontext ) + raise EstablishContextException(hresult) + hresult, readers = SCardListReaderGroups(hcontext) if hresult!=0: - raise ListReadersException( hresult ) - hresult = SCardReleaseContext( hcontext ) + raise ListReadersException(hresult) + hresult = SCardReleaseContext(hcontext) if hresult!=0: - raise ReleaseContextException( hresult ) + raise ReleaseContextException(hresult) return readers - def addreadergroup( self, newgroup ): + def addreadergroup(self, newgroup): """Add a reader group""" - innerreadergroups.addreadergroup( self, newgroup ) + innerreadergroups.addreadergroup(self, newgroup) - hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if 0!=hresult: + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if 0 != hresult: raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) try: - hresult = SCardIntroduceReaderGroup( hcontext, newgroup ) - if 0!=hresult: + hresult = SCardIntroduceReaderGroup(hcontext, newgroup) + if 0 != hresult: raise error, 'Unable to introduce reader group: ' + SCardGetErrorMessage(hresult) finally: - hresult = SCardReleaseContext( hcontext ) - if 0!=hresult: + hresult = SCardReleaseContext(hcontext) + if 0 != hresult: raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) - def removereadergroup( self, group ): + def removereadergroup(self, group): """Remove a reader group""" - innerreadergroups.removereadergroup( self, group ) + innerreadergroups.removereadergroup(self, group) - hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if 0!=hresult: + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if 0 != hresult: raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) try: - hresult = SCardForgetReaderGroup( hcontext, group ) + hresult = SCardForgetReaderGroup(hcontext, group) if hresult!=0: raise error, 'Unable to forget reader group: ' + SCardGetErrorMessage(hresult) finally: - hresult = SCardReleaseContext( hcontext ) - if 0!=hresult: + hresult = SCardReleaseContext(hcontext) + if 0 != hresult: raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) -class PCSCReaderGroups( readergroups ): + +class PCSCReaderGroups(readergroups): """PCSC readers groups.""" """The single instance of __readergroups""" instance = None """Constructor: create a single instance of __readergroups on first call""" - def __init__(self, initlist=None ): - if None==PCSCReaderGroups.instance: - PCSCReaderGroups.instance = pcscinnerreadergroups( initlist ) + def __init__(self, initlist=None): + if None == PCSCReaderGroups.instance: + PCSCReaderGroups.instance = pcscinnerreadergroups(initlist) + """All operators redirected to inner class.""" + def __getattr__(self, name): return getattr(self.instance, name) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 15:18:16
|
Revision: 429 http://pyscard.svn.sourceforge.net/pyscard/?rev=429&view=rev Author: ludov Date: 2010-06-06 15:18:10 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReader.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2010-06-06 15:14:35 UTC (rev 428) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2010-06-06 15:18:10 UTC (rev 429) @@ -31,88 +31,90 @@ from smartcard.pcsc.PCSCExceptions import * from smartcard.scard import * -def __PCSCreaders__( hcontext, groups=[] ): + +def __PCSCreaders__(hcontext, groups=[]): """Returns the list of PCSC smartcard readers in PCSC group. If group is not specified, returns the list of all PCSC smartcard readers. """ # in case we have a string instead of a list - if isinstance( groups, type("")): - groups=[groups] - hresult, readers = SCardListReaders( hcontext, groups ) - if hresult!=0: - if hresult==SCARD_E_NO_READERS_AVAILABLE: - readers=[] + if isinstance(groups, type("")): + groups = [groups] + hresult, readers = SCardListReaders(hcontext, groups) + if hresult != 0: + if hresult == SCARD_E_NO_READERS_AVAILABLE: + readers = [] else: - raise ListReadersException( hresult ) + raise ListReadersException(hresult) return readers -class PCSCReader( Reader ): +class PCSCReader(Reader): """PCSC reader class.""" - def __init__( self, readername ): + + def __init__(self, readername): """Constructs a new PCSC reader.""" - Reader.__init__( self, readername ) + Reader.__init__(self, readername) - def addtoreadergroup( self, groupname ): + def addtoreadergroup(self, groupname): """Add reader to a reader group.""" - hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if 0!=hresult: + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if 0 != hresult: raise EstablishContextException(hresult) try: - hresult = SCardIntroduceReader( hcontext, self.name, self.name ) - if 0!=hresult and SCARD_E_DUPLICATE_READER!=hresult: + hresult = SCardIntroduceReader(hcontext, self.name, self.name) + if 0 != hresult and SCARD_E_DUPLICATE_READER != hresult: raise error, 'Unable to introduce reader: ' + self.name + ' : ' + SCardGetErrorMessage(hresult) - hresult = SCardAddReaderToGroup( hcontext, self.name, groupname ) - if hresult!=0: + hresult = SCardAddReaderToGroup(hcontext, self.name, groupname) + if 0 != hresult: raise error, 'Unable to add reader to group: ' + SCardGetErrorMessage(hresult) finally: - hresult = SCardReleaseContext( hcontext ) - if 0!=hresult: + hresult = SCardReleaseContext(hcontext) + if 0 != hresult: raise ReleaseContextException(hresult) - - def removefromreadergroup( self, groupname ): + def removefromreadergroup(self, groupname): """Remove a reader from a reader group""" - hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if 0!=hresult: + hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if 0 != hresult: raise EstablishContextException(hresult) try: - hresult = SCardRemoveReaderFromGroup( hcontext, self.name, groupname ) - if hresult!=0: + hresult = SCardRemoveReaderFromGroup(hcontext, self.name, groupname) + if 0 != hresult: raise error, 'Unable to add reader to group: ' + SCardGetErrorMessage(hresult) finally: - hresult = SCardReleaseContext( hcontext ) - if 0!=hresult: + hresult = SCardReleaseContext(hcontext) + if 0 != hresult: raise ReleaseContextException(hresult) - - def createConnection( self ): + def createConnection(self): """Return a card connection thru PCSC reader.""" - return CardConnectionDecorator( PCSCCardConnection( self.name ) ) + return CardConnectionDecorator(PCSCCardConnection(self.name)) class Factory: - def create(self, readername ): - return PCSCReader( readername ) -def readers( groups=[] ): - creaders=[] + def create(self, readername): + return PCSCReader(readername) + + +def readers(groups=[]): + creaders = [] hcontext = PCSCContext().getContext() - for reader in __PCSCreaders__( hcontext, groups ): - creaders.append( ReaderFactory.createReader( 'smartcard.pcsc.PCSCReader.PCSCReader', reader ) ) + for reader in __PCSCreaders__(hcontext, groups): + creaders.append(ReaderFactory.createReader('smartcard.pcsc.PCSCReader.PCSCReader', reader)) return creaders if __name__ == '__main__': SELECT = [0xA0, 0xA4, 0x00, 0x00, 0x02] DF_TELECOM = [0x7F, 0x10] - creaders=readers() + creaders = readers() cc = creaders[0].createConnection() cc.connect() - data, sw1, sw2 = cc.transmit( SELECT + DF_TELECOM ) + data, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) print "%X %X" % (sw1, sw2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 15:14:41
|
Revision: 428 http://pyscard.svn.sourceforge.net/pyscard/?rev=428&view=rev Author: ludov Date: 2010-06-06 15:14:35 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-06-06 15:10:44 UTC (rev 427) +++ trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-06-06 15:14:35 UTC (rev 428) @@ -48,26 +48,25 @@ FEATURE_CCID_ESC_COMMAND = 0x13 Features = { -"FEATURE_VERIFY_PIN_START" : FEATURE_VERIFY_PIN_START, -"FEATURE_VERIFY_PIN_FINISH" : FEATURE_VERIFY_PIN_FINISH, -"FEATURE_MODIFY_PIN_START" : FEATURE_MODIFY_PIN_START, -"FEATURE_MODIFY_PIN_FINISH" : FEATURE_MODIFY_PIN_FINISH, -"FEATURE_GET_KEY_PRESSED" : FEATURE_GET_KEY_PRESSED, -"FEATURE_VERIFY_PIN_DIRECT" : FEATURE_VERIFY_PIN_DIRECT, -"FEATURE_MODIFY_PIN_DIRECT" : FEATURE_MODIFY_PIN_DIRECT, -"FEATURE_MCT_READER_DIRECT" : FEATURE_MCT_READER_DIRECT, -"FEATURE_MCT_UNIVERSAL" : FEATURE_MCT_UNIVERSAL, -"FEATURE_IFD_PIN_PROPERTIES" : FEATURE_IFD_PIN_PROPERTIES, -"FEATURE_ABORT" : FEATURE_ABORT, -"FEATURE_SET_SPE_MESSAGE" : FEATURE_SET_SPE_MESSAGE, -"FEATURE_VERIFY_PIN_DIRECT_APP_ID" : FEATURE_VERIFY_PIN_DIRECT_APP_ID, -"FEATURE_MODIFY_PIN_DIRECT_APP_ID" : FEATURE_MODIFY_PIN_DIRECT_APP_ID, -"FEATURE_WRITE_DISPLAY" : FEATURE_WRITE_DISPLAY, -"FEATURE_GET_KEY" : FEATURE_GET_KEY, -"FEATURE_IFD_DISPLAY_PROPERTIES" : FEATURE_IFD_DISPLAY_PROPERTIES, -"FEATURE_GET_TLV_PROPERTIES" : FEATURE_GET_TLV_PROPERTIES, -"FEATURE_CCID_ESC_COMMAND" : FEATURE_CCID_ESC_COMMAND -} +"FEATURE_VERIFY_PIN_START": FEATURE_VERIFY_PIN_START, +"FEATURE_VERIFY_PIN_FINISH": FEATURE_VERIFY_PIN_FINISH, +"FEATURE_MODIFY_PIN_START": FEATURE_MODIFY_PIN_START, +"FEATURE_MODIFY_PIN_FINISH": FEATURE_MODIFY_PIN_FINISH, +"FEATURE_GET_KEY_PRESSED": FEATURE_GET_KEY_PRESSED, +"FEATURE_VERIFY_PIN_DIRECT": FEATURE_VERIFY_PIN_DIRECT, +"FEATURE_MODIFY_PIN_DIRECT": FEATURE_MODIFY_PIN_DIRECT, +"FEATURE_MCT_READER_DIRECT": FEATURE_MCT_READER_DIRECT, +"FEATURE_MCT_UNIVERSAL": FEATURE_MCT_UNIVERSAL, +"FEATURE_IFD_PIN_PROPERTIES": FEATURE_IFD_PIN_PROPERTIES, +"FEATURE_ABORT": FEATURE_ABORT, +"FEATURE_SET_SPE_MESSAGE": FEATURE_SET_SPE_MESSAGE, +"FEATURE_VERIFY_PIN_DIRECT_APP_ID": FEATURE_VERIFY_PIN_DIRECT_APP_ID, +"FEATURE_MODIFY_PIN_DIRECT_APP_ID": FEATURE_MODIFY_PIN_DIRECT_APP_ID, +"FEATURE_WRITE_DISPLAY": FEATURE_WRITE_DISPLAY, +"FEATURE_GET_KEY": FEATURE_GET_KEY, +"FEATURE_IFD_DISPLAY_PROPERTIES": FEATURE_IFD_DISPLAY_PROPERTIES, +"FEATURE_GET_TLV_PROPERTIES": FEATURE_GET_TLV_PROPERTIES, +"FEATURE_CCID_ESC_COMMAND": FEATURE_CCID_ESC_COMMAND} # properties returned by FEATURE_GET_TLV_PROPERTIES PCSCv2_PART10_PROPERTY_wLcdLayout = 1 @@ -81,15 +80,14 @@ PCSCv2_PART10_PROPERTY_bPPDUSupport = 9 Properties = { -"PCSCv2_PART10_PROPERTY_wLcdLayout" : PCSCv2_PART10_PROPERTY_wLcdLayout, +"PCSCv2_PART10_PROPERTY_wLcdLayout": PCSCv2_PART10_PROPERTY_wLcdLayout, "PCSCv2_PART10_PROPERTY_bEntryValidationCondition": PCSCv2_PART10_PROPERTY_bEntryValidationCondition, "PCSCv2_PART10_PROPERTY_bTimeOut2": PCSCv2_PART10_PROPERTY_bTimeOut2, "PCSCv2_PART10_PROPERTY_wLcdMaxCharacters": PCSCv2_PART10_PROPERTY_wLcdMaxCharacters, "PCSCv2_PART10_PROPERTY_wLcdMaxLines": PCSCv2_PART10_PROPERTY_wLcdMaxLines, "PCSCv2_PART10_PROPERTY_bMinPINSize": PCSCv2_PART10_PROPERTY_bMinPINSize, "PCSCv2_PART10_PROPERTY_bMaxPINSize": PCSCv2_PART10_PROPERTY_bMaxPINSize, -"PCSCv2_PART10_PROPERTY_sFirmwareID": PCSCv2_PART10_PROPERTY_sFirmwareID -} +"PCSCv2_PART10_PROPERTY_sFirmwareID": PCSCv2_PART10_PROPERTY_sFirmwareID} # we already have: Features['FEATURE_x'] = FEATURE_x # we will now also have: Features[FEATURE_x] = 'FEATURE_x' @@ -147,7 +145,7 @@ controlCode = hasFeature(featureList, FEATURE_IFD_PIN_PROPERTIES) if controlCode is None: - return { 'raw': [] } + return {'raw': []} response = cardConnection.control(controlCode, []) d = { @@ -155,8 +153,7 @@ 'LcdLayoutX': response[0], 'LcdLayoutY': response[1], 'EntryValidationCondition': response[2], - 'TimeOut2': response[3] - } + 'TimeOut2': response[3]} return d @@ -175,7 +172,7 @@ controlCode = hasFeature(featureList, FEATURE_GET_TLV_PROPERTIES) if controlCode is None: - return { 'raw': [] } + return {'raw': []} response = cardConnection.control(controlCode, []) d = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 15:10:50
|
Revision: 427 http://pyscard.svn.sourceforge.net/pyscard/?rev=427&view=rev Author: ludov Date: 2010-06-06 15:10:44 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-06-06 15:08:13 UTC (rev 426) +++ trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-06-06 15:10:44 UTC (rev 427) @@ -27,6 +27,7 @@ # gemalto scard library import smartcard.scard + class BaseSCardException: """Base class for scard (aka PCSC) exceptions. @@ -34,40 +35,52 @@ low-level PCSC access to readers and cards. """ - def __init__( self, hresult ): + + def __init__(self, hresult): """Constructor that stores the pcsc error status.""" - self.hresult=hresult + self.hresult = hresult def __str__(self): """Returns a string representation of the exception.""" - return repr("scard exception: " + + return repr("scard exception: " + smartcard.scard.SCardGetErrorMessage(self.hresult)) + class EstablishContextException(BaseSCardException): """Raised when scard failed to establish context with PCSC.""" def __str__(self): """Returns a string representation of the exception.""" - return repr( 'Failure to establish context: ' + smartcard.scard.SCardGetErrorMessage(self.hresult) ) + return repr('Failure to establish context: ' + + smartcard.scard.SCardGetErrorMessage(self.hresult)) + class ListReadersException(BaseSCardException): """Raised when scard failed to list readers.""" + def __str__(self): - return repr( 'Failure to list readers: ' + smartcard.scard.SCardGetErrorMessage(self.hresult) ) + return repr('Failure to list readers: ' + + smartcard.scard.SCardGetErrorMessage(self.hresult)) + class EstablishContextException(BaseSCardException): """Raised when scard failed to establish a PCSC context.""" + def __str__(self): - return repr( 'Failure to establish context: ' + smartcard.scard.SCardGetErrorMessage(self.hresult) ) + return repr('Failure to establish context: ' + + smartcard.scard.SCardGetErrorMessage(self.hresult)) + class ReleaseContextException(BaseSCardException): """Raised when scard failed to release PCSC context.""" + def __str__(self): - return repr( 'Failure to release context: ' + smartcard.scard.SCardGetErrorMessage(self.hresult) ) + return repr('Failure to release context: ' + + smartcard.scard.SCardGetErrorMessage(self.hresult)) if __name__ == "__main__": import sys try: - raise EstablishContextException( smartcard.scard.SCARD_E_NO_MEMORY ) + raise EstablishContextException(smartcard.scard.SCARD_E_NO_MEMORY) except BaseSCardException as exc: print exc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 15:08:19
|
Revision: 426 http://pyscard.svn.sourceforge.net/pyscard/?rev=426&view=rev Author: ludov Date: 2010-06-06 15:08:13 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCContext.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCContext.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2010-06-06 15:03:39 UTC (rev 425) +++ trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2010-06-06 15:08:13 UTC (rev 426) @@ -27,24 +27,26 @@ from smartcard.scard import * from smartcard.pcsc.PCSCExceptions import EstablishContextException + class PCSCContext: """Manage a singleton pcsc context handle.""" class __PCSCContextSingleton: """The actual pcsc context class as a singleton.""" - def __init__( self ): - hresult, self.hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if hresult!=0: + + def __init__(self): + hresult, self.hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if hresult != 0: raise EstablishContextException(hresult) - def getContext( self ): + def getContext(self): return self.hcontext # the singleton mutex = RLock() instance = None - def __init__( self ): + def __init__(self): PCSCContext.mutex.acquire() try: if not PCSCContext.instance: @@ -52,6 +54,6 @@ finally: PCSCContext.mutex.release() - def __getattr__( self, name ): + def __getattr__(self, name): if self.instance: - return getattr( self.instance, name ) + return getattr(self.instance, name) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 15:03:45
|
Revision: 425 http://pyscard.svn.sourceforge.net/pyscard/?rev=425&view=rev Author: ludov Date: 2010-06-06 15:03:39 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCCardRequest.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCCardRequest.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCCardRequest.py 2010-06-06 14:50:18 UTC (rev 424) +++ trunk/pyscard/src/smartcard/pcsc/PCSCCardRequest.py 2010-06-06 15:03:39 UTC (rev 425) @@ -33,92 +33,96 @@ from smartcard.scard import * -def signalEvent( evt, isInfinite ): + +def signalEvent(evt, isInfinite): if not isInfinite: evt.set() + class PCSCCardRequest(AbstractCardRequest): """PCSC CardRequest class.""" - def __init__( self, newcardonly=False, readers=None, cardType=None, cardServiceClass=None, timeout=1 ): + def __init__(self, newcardonly=False, readers=None, cardType=None, cardServiceClass=None, timeout=1): """Construct new PCSCCardRequest. newcardonly: if True, request a new card - default is False, i.e. accepts cards already inserted + default is False, i.e. accepts cards already + inserted - readers: the list of readers to consider for requesting a card - default is to consider all readers + readers: the list of readers to consider for requesting + a card default is to consider all readers - cardTypeClass: the CardType class to wait for; default is AnyCardType, i.e. - the request will returns with new or already inserted cards + cardTypeClass: the CardType class to wait for; default is + AnyCardType, i.e. the request will returns + with new or already inserted cards - cardServiceClass: the specific card service class to create and bind to the card - default is to create and bind a PassThruCardService + cardServiceClass: the specific card service class to create and + bind to the card default is to create and + bind a PassThruCardService - timeout: the time in seconds we are ready to wait for connecting to the - requested card. - default is to wait one second - to wait forever, set timeout to None + timeout: the time in seconds we are ready to wait for + connecting to the requested card. default + is to wait one second to wait forever, set + timeout to None """ - AbstractCardRequest.__init__( self, newcardonly, readers, cardType, cardServiceClass, timeout ) + AbstractCardRequest.__init__(self, newcardonly, readers, cardType, cardServiceClass, timeout) # polling interval in s for SCardGetStatusChange - self.pollinginterval=0.1 + self.pollinginterval = 0.1 # if timeout is None, translate to scard.INFINITE - if None==self.timeout: - self.timeout=INFINITE + if None == self.timeout: + self.timeout = INFINITE # otherwise, from seconds to milliseconds else: - self.timeout=int( self.timeout ) + self.timeout = int(self.timeout) self.hcontext = PCSCContext().getContext() - def getReaderNames( self ): + def getReaderNames(self): """Returns the list or PCSC readers on which to wait for cards.""" # get inserted readers - hresult, pcscreaders = SCardListReaders( self.hcontext, [] ) - if 0!=hresult and SCARD_E_NO_READERS_AVAILABLE!=hresult: - raise ListReadersException( hresult ) + hresult, pcscreaders = SCardListReaders(self.hcontext, []) + if 0 != hresult and SCARD_E_NO_READERS_AVAILABLE != hresult: + raise ListReadersException(hresult) - readers=[] + readers = [] # if no readers asked, use all inserted readers - if None==self.readersAsked: + if None == self.readersAsked: readers = pcscreaders # otherwise use only the asked readers that are inserted else: for reader in self.readersAsked: - if not isinstance( reader, type("")): - reader=str(reader) + if not isinstance(reader, type("")): + reader = str(reader) if reader in pcscreaders: - readers = readers + [ reader ] + readers = readers + [reader] return readers - - def waitforcard( self ): + def waitforcard(self): """Wait for card insertion and returns a card service.""" - AbstractCardRequest.waitforcard( self ) - cardfound=False + AbstractCardRequest.waitforcard(self) + cardfound = False # for non infinite timeout, a timer will signal the end of the time-out by setting the evt event evt = threading.Event() - if INFINITE==self.timeout: - timertimeout=1 + if INFINITE == self.timeout: + timertimeout = 1 else: - timertimeout=self.timeout - timer = threading.Timer( timertimeout, signalEvent, [evt, INFINITE==self.timeout] ) + timertimeout = self.timeout + timer = threading.Timer(timertimeout, signalEvent, [evt, INFINITE == self.timeout]) # create a dictionary entry for new readers readerstates = {} readernames = self.getReaderNames() for reader in readernames: - if not readerstates.has_key( reader ): - readerstates[ reader ] = ( reader, SCARD_STATE_UNAWARE ) + if not readerstates.has_key(reader): + readerstates[reader] = (reader, SCARD_STATE_UNAWARE) # remove dictionary entry for readers that disappeared for oldreader in readerstates.keys(): @@ -126,54 +130,53 @@ del readerstates[oldreader] # call SCardGetStatusChange only if we have some readers - if {}!=readerstates: - hresult, newstates = SCardGetStatusChange( self.hcontext, 0, readerstates.values() ) + if {} != readerstates: + hresult, newstates = SCardGetStatusChange(self.hcontext, 0, readerstates.values()) else: - hresult=0 - newstates=[] + hresult = 0 + newstates = [] # we can expect normally time-outs or reader disappearing just before the call # otherwise, raise execption on error - if 0!=hresult and SCARD_E_TIMEOUT!=hresult and SCARD_E_UNKNOWN_READER!=hresult: - raise CardRequestException( 'Failed to SCardGetStatusChange ' + SCardGetErrorMessage(hresult) ) + if 0 != hresult and SCARD_E_TIMEOUT != hresult and SCARD_E_UNKNOWN_READER != hresult: + raise CardRequestException('Failed to SCardGetStatusChange ' + SCardGetErrorMessage(hresult)) # in case of timeout or reader disappearing, the content of the states is useless # in which case we clear the changed bit - if SCARD_E_TIMEOUT==hresult or SCARD_E_UNKNOWN_READER==hresult: + if SCARD_E_TIMEOUT == hresult or SCARD_E_UNKNOWN_READER == hresult: for state in newstates: state[1] = state[1] & (0xFFFFFFFF ^ SCARD_STATE_CHANGED) - - + # update readerstate for state in newstates: readername, eventstate, atr = state - readerstates[readername] = ( readername, eventstate ) + readerstates[readername] = (readername, eventstate) # if a new card is not requested, just return the first available if not self.newcardonly: for state in newstates: readername, eventstate, atr = state if eventstate & SCARD_STATE_PRESENT: - reader=PCSCReader(readername) - if self.cardType.matches( atr, reader ): - if self.cardServiceClass.supports( 'dummy' ): - cardfound=True - return self.cardServiceClass( reader.createConnection() ) + reader = PCSCReader(readername) + if self.cardType.matches(atr, reader): + if self.cardServiceClass.supports('dummy'): + cardfound = True + return self.cardServiceClass(reader.createConnection()) - timerstarted=False + timerstarted = False while not evt.isSet() and not cardfound: if not timerstarted: - timerstarted=True + timerstarted = True timer.start() - time.sleep( self.pollinginterval ) + time.sleep(self.pollinginterval) # create a dictionary entry for new readers readernames = self.getReaderNames() for reader in readernames: - if not readerstates.has_key( reader ): - readerstates[ reader ] = ( reader, SCARD_STATE_UNAWARE ) + if not readerstates.has_key(reader): + readerstates[reader] = (reader, SCARD_STATE_UNAWARE) # remove dictionary entry for readers that disappeared for oldreader in readerstates.keys(): @@ -181,25 +184,25 @@ del readerstates[oldreader] # wait for card insertion - if {}!=readerstates: - hresult, newstates = SCardGetStatusChange( self.hcontext, 0, readerstates.values() ) + if {} != readerstates: + hresult, newstates = SCardGetStatusChange(self.hcontext, 0, readerstates.values()) else: hresult = SCARD_E_TIMEOUT - newstates=[] + newstates = [] # time-out - if SCARD_E_TIMEOUT==hresult: + if SCARD_E_TIMEOUT == hresult: if evt.isSet(): raise CardRequestTimeoutException() # reader vanished before or during the call - elif SCARD_E_UNKNOWN_READER==hresult: + elif SCARD_E_UNKNOWN_READER == hresult: pass # some error happened - elif 0!=hresult: + elif 0 != hresult: timer.cancel() - raise CardRequestException( 'Failed to get status change ' + SCardGetErrorMessage(hresult) ) + raise CardRequestException('Failed to get status change ' + SCardGetErrorMessage(hresult)) # something changed! else: @@ -217,83 +220,81 @@ # if a new card is requested, clear the state changed bit if # the card was already inserted and is still inserted if self.newcardonly: - if oldstate & SCARD_STATE_PRESENT and eventstate & ( SCARD_STATE_CHANGED | SCARD_STATE_PRESENT ): + if oldstate & SCARD_STATE_PRESENT and eventstate & (SCARD_STATE_CHANGED | SCARD_STATE_PRESENT): eventstate = eventstate & (0xFFFFFFFF ^ SCARD_STATE_CHANGED) if (self.newcardonly and eventstate & SCARD_STATE_PRESENT and eventstate & SCARD_STATE_CHANGED) or \ (not self.newcardonly and eventstate & SCARD_STATE_PRESENT): - reader=PCSCReader(readername) - if self.cardType.matches( atr, reader ): - if self.cardServiceClass.supports( 'dummy' ): - cardfound=True + reader = PCSCReader(readername) + if self.cardType.matches(atr, reader): + if self.cardServiceClass.supports('dummy'): + cardfound = True timer.cancel() - return self.cardServiceClass( reader.createConnection() ) + return self.cardServiceClass(reader.createConnection()) # update state dictionary - readerstates[readername] = ( readername, eventstate ) + readerstates[readername] = (readername, eventstate) if evt.isSet(): raise CardRequestTimeoutException() - - - def waitforcardevent( self ): + def waitforcardevent(self): """Wait for card insertion or removal.""" - AbstractCardRequest.waitforcardevent( self ) + AbstractCardRequest.waitforcardevent(self) presentcards = [] evt = threading.Event() # for non infinite timeout, a timer will signal the end of the time-out - if INFINITE==self.timeout: - timertimeout=1 + if INFINITE == self.timeout: + timertimeout = 1 else: - timertimeout=self.timeout - timer = threading.Timer( timertimeout, signalEvent, [evt, INFINITE==self.timeout] ) + timertimeout = self.timeout + timer = threading.Timer(timertimeout, signalEvent, [evt, INFINITE == self.timeout]) # get status change until time-out, e.g. evt is set readerstates = {} - timerstarted=False + timerstarted = False while not evt.isSet(): if not timerstarted: - timerstarted=True + timerstarted = True timer.start() - time.sleep( self.pollinginterval ) + time.sleep(self.pollinginterval) # reinitialize at each iteration just in case a new reader appeared readernames = self.getReaderNames() for reader in readernames: # create a dictionary entry for new readers - if not readerstates.has_key( reader ): - readerstates[reader] = ( reader, SCARD_STATE_UNAWARE ) + if not readerstates.has_key(reader): + readerstates[reader] = (reader, SCARD_STATE_UNAWARE) # remove dictionary entry for readers that disappeared for oldreader in readerstates.keys(): if oldreader not in readernames: del readerstates[oldreader] # get status change - if {}!=readerstates: - hresult, newstates = SCardGetStatusChange( self.hcontext, 0, readerstates.values() ) + if {} != readerstates: + hresult, newstates = SCardGetStatusChange(self.hcontext, 0, readerstates.values()) else: hresult = 0 - newstates=[] + newstates = [] # time-out - if SCARD_E_TIMEOUT==hresult: + if SCARD_E_TIMEOUT == hresult: if evt.isSet(): raise CardRequestTimeoutException() # the reader was unplugged during the loop - elif SCARD_E_UNKNOWN_READER==hresult: + elif SCARD_E_UNKNOWN_READER == hresult: pass # some error happened - elif 0!=hresult: + elif 0 != hresult: timer.cancel() - raise CardRequestException( 'Failed to get status change ' + SCardGetErrorMessage(hresult) ) + raise CardRequestException('Failed to get status change ' + SCardGetErrorMessage(hresult)) # something changed! else: @@ -305,11 +306,11 @@ # the status can change on a card already inserted, e.g. # unpowered, in use, ... Clear the state changed bit if # the card was already inserted and is still inserted - if oldstate & SCARD_STATE_PRESENT and eventstate & ( SCARD_STATE_CHANGED | SCARD_STATE_PRESENT ): + if oldstate & SCARD_STATE_PRESENT and eventstate & (SCARD_STATE_CHANGED | SCARD_STATE_PRESENT): eventstate = eventstate & (0xFFFFFFFF ^ SCARD_STATE_CHANGED) if eventstate & SCARD_STATE_PRESENT and eventstate & SCARD_STATE_CHANGED: - presentcards.append( Card.Card( readername, atr ) ) + presentcards.append(Card.Card(readername, atr)) return presentcards if evt.isSet(): @@ -320,7 +321,7 @@ from smartcard.util import toHexString print 'Insert a new card within 10 seconds' - cr=PCSCCardRequest( timeout=10, newcardonly=True ) + cr = PCSCCardRequest(timeout=10, newcardonly=True) cs = cr.waitforcard() cs.connection.connect() print cs.connection.getReader(), toHexString(cs.connection.getATR()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 14:50:24
|
Revision: 424 http://pyscard.svn.sourceforge.net/pyscard/?rev=424&view=rev Author: ludov Date: 2010-06-06 14:50:18 +0000 (Sun, 06 Jun 2010) Log Message: ----------- make pep8 happy Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCCardConnection.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCCardConnection.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCCardConnection.py 2010-06-06 14:35:32 UTC (rev 423) +++ trunk/pyscard/src/smartcard/pcsc/PCSCCardConnection.py 2010-06-06 14:50:18 UTC (rev 424) @@ -28,10 +28,11 @@ from smartcard.scard import * -def translateprotocolmask( protocol ): + +def translateprotocolmask(protocol): """Translate CardConnection protocol mask into PCSC protocol mask.""" pcscprotocol = 0 - if None!=protocol: + if None != protocol: if CardConnection.T0_protocol & protocol: pcscprotocol |= SCARD_PROTOCOL_T0 if CardConnection.T1_protocol & protocol: @@ -42,80 +43,86 @@ pcscprotocol |= SCARD_PROTOCOL_T15 return pcscprotocol -def translateprotocolheader( protocol ): + +def translateprotocolheader(protocol): """Translate protocol into PCSC protocol header.""" pcscprotocol = 0 - if None!=protocol: - if CardConnection.T0_protocol==protocol: + if None != protocol: + if CardConnection.T0_protocol == protocol: pcscprotocol = SCARD_PCI_T0 - if CardConnection.T1_protocol==protocol: + if CardConnection.T1_protocol == protocol: pcscprotocol = SCARD_PCI_T1 - if CardConnection.RAW_protocol==protocol: + if CardConnection.RAW_protocol == protocol: pcscprotocol = SCARD_PCI_RAW return pcscprotocol -dictProtocolHeader = { SCARD_PCI_T0:'T0', SCARD_PCI_T1:'T1', SCARD_PCI_RAW:'RAW' } -dictProtocol = { SCARD_PROTOCOL_T0:'T0', SCARD_PROTOCOL_T1:'T1', SCARD_PROTOCOL_RAW:'RAW', - SCARD_PROTOCOL_T15:'T15', SCARD_PROTOCOL_T0|SCARD_PROTOCOL_T1:'T0 or T1' } +dictProtocolHeader = {SCARD_PCI_T0: 'T0', SCARD_PCI_T1: 'T1', + SCARD_PCI_RAW: 'RAW'} +dictProtocol = {SCARD_PROTOCOL_T0: 'T0', SCARD_PROTOCOL_T1: 'T1', + SCARD_PROTOCOL_RAW: 'RAW', SCARD_PROTOCOL_T15: 'T15', + SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1: 'T0 or T1'} -class PCSCCardConnection( CardConnection ): - """PCSCCard connection class. Handles connection with a card thru a PCSC reader.""" - def __init__( self, reader ): +class PCSCCardConnection(CardConnection): + """PCSCCard connection class. Handles connection with a card thru a + PCSC reader.""" + + def __init__(self, reader): """Construct a new PCSC card connection. reader: the reader in which the smartcard to connect to is located. """ - CardConnection.__init__( self, reader ) + CardConnection.__init__(self, reader) self.hcard = None - hresult, self.hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) - if hresult!=0: - raise CardConnectionException( 'Failed to establish context : ' + SCardGetErrorMessage(hresult) ) + hresult, self.hcontext = SCardEstablishContext(SCARD_SCOPE_USER) + if hresult != 0: + raise CardConnectionException('Failed to establish context : ' + SCardGetErrorMessage(hresult)) - def __del__( self ): + def __del__(self): """Destructor. Clean PCSC connection resources.""" # race condition: module CardConnection # can disappear before __del__ is called self.disconnect() - hresult = SCardReleaseContext( self.hcontext ) - if hresult!=0: - raise CardConnectionException( 'Failed to release context: ' + SCardGetErrorMessage(hresult) ) - CardConnection.__del__( self ) + hresult = SCardReleaseContext(self.hcontext) + if hresult != 0: + raise CardConnectionException('Failed to release context: ' + SCardGetErrorMessage(hresult)) + CardConnection.__del__(self) - def connect( self, protocol=None, mode=None, disposition=None ): + def connect(self, protocol=None, mode=None, disposition=None): """Connect to the card. - - If protocol is not specified, connect with the default connection protocol. - + + If protocol is not specified, connect with the default + connection protocol. + If mode is not specified, connect with SCARD_SHARE_SHARED.""" - CardConnection.connect( self, protocol ) - pcscprotocol = translateprotocolmask( protocol ) - if 0==pcscprotocol: + CardConnection.connect(self, protocol) + pcscprotocol = translateprotocolmask(protocol) + if 0 == pcscprotocol: pcscprotocol = self.getProtocol() - if mode==None: + if mode == None: mode = SCARD_SHARE_SHARED # store the way to dispose the card - if disposition==None: + if disposition == None: disposition = SCARD_UNPOWER_CARD self.disposition = disposition hresult, self.hcard, dwActiveProtocol = SCardConnect( - self.hcontext, str(self.reader), mode, pcscprotocol ) - if hresult!=0: - self.hcard=None - if SCARD_W_REMOVED_CARD==hresult: - raise NoCardException( 'Unable to connect: ' + SCardGetErrorMessage(hresult) ) + self.hcontext, str(self.reader), mode, pcscprotocol) + if hresult != 0: + self.hcard = None + if SCARD_W_REMOVED_CARD == hresult: + raise NoCardException('Unable to connect: ' + SCardGetErrorMessage(hresult)) else: - raise CardConnectionException( 'Unable to connect with protocol: ' + dictProtocol[pcscprotocol] + '. ' + SCardGetErrorMessage(hresult) ) + raise CardConnectionException('Unable to connect with protocol: ' + dictProtocol[pcscprotocol] + '. ' + SCardGetErrorMessage(hresult)) protocol = 0 for p in dictProtocol: if p == dwActiveProtocol: protocol = eval("CardConnection.%s_protocol" % dictProtocol[p]) PCSCCardConnection.setProtocol(self, protocol) - def disconnect( self ): + def disconnect(self): """Disconnect from the card.""" # when __del__() is invoked in response to a module being deleted, @@ -123,26 +130,26 @@ # by the __del__() method may already have been deleted. # this causes CardConnection.disconnect to except with a TypeError try: - CardConnection.disconnect( self ) + CardConnection.disconnect(self) except TypeError: pass - if None!=self.hcard: - hresult = SCardDisconnect( self.hcard, self.disposition ) - if hresult!=0: - raise CardConnectionException( 'Failed to disconnect: ' + SCardGetErrorMessage(hresult) ) + if None != self.hcard: + hresult = SCardDisconnect(self.hcard, self.disposition) + if hresult != 0: + raise CardConnectionException('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) self.hcard = None - def getATR( self ): + def getATR(self): """Return card ATR""" - CardConnection.getATR( self ) - if None==self.hcard: - raise CardConnectionException( 'Card not connected' ) - hresult, reader, state, protocol, atr = SCardStatus( self.hcard ) - if hresult!=0: - raise CardConnectionException( 'Failed to get status: ' + SCardGetErrorMessage(hresult) ) + CardConnection.getATR(self) + if None == self.hcard: + raise CardConnectionException('Card not connected') + hresult, reader, state, protocol, atr = SCardStatus(self.hcard) + if hresult != 0: + raise CardConnectionException('Failed to get status: ' + SCardGetErrorMessage(hresult)) return atr - def doTransmit( self, bytes, protocol=None ): + def doTransmit(self, bytes, protocol=None): """Transmit an apdu to the card and return response apdu. bytes: command apdu to transmit (list of bytes) @@ -155,25 +162,25 @@ sw2 is status word 2, e.g. 0x1A response are the response bytes excluding status words """ - if None==protocol: + if None == protocol: protocol = self.getProtocol() - CardConnection.doTransmit( self, bytes, protocol ) - pcscprotocolheader = translateprotocolheader( protocol ) - if 0==pcscprotocolheader: - raise CardConnectionException( 'Invalid protocol in transmit: must be CardConnection.T0_protocol, CardConnection.T1_protocol, or CardConnection.RAW_protocol' ) - if None==self.hcard: - raise CardConnectionException( 'Card not connected' ) - hresult, response = SCardTransmit( self.hcard, pcscprotocolheader, bytes ) - if hresult!=0: - raise CardConnectionException( 'Failed to transmit with protocol ' + dictProtocolHeader[pcscprotocolheader] + '. ' + SCardGetErrorMessage(hresult) ) + CardConnection.doTransmit(self, bytes, protocol) + pcscprotocolheader = translateprotocolheader(protocol) + if 0 == pcscprotocolheader: + raise CardConnectionException('Invalid protocol in transmit: must be CardConnection.T0_protocol, CardConnection.T1_protocol, or CardConnection.RAW_protocol') + if None == self.hcard: + raise CardConnectionException('Card not connected') + hresult, response = SCardTransmit(self.hcard, pcscprotocolheader, bytes) + if hresult != 0: + raise CardConnectionException('Failed to transmit with protocol ' + dictProtocolHeader[pcscprotocolheader] + '. ' + SCardGetErrorMessage(hresult)) - sw1=(response[-2]+256)%256 - sw2=(response[-1]+256)%256 + sw1 = (response[-2] + 256) % 256 + sw2 = (response[-1] + 256) % 256 - data = map(lambda x: (x+256)%256, response[:-2]) + data = map(lambda x: (x + 256) % 256, response[:-2]) return data, sw1, sw2 - def doControl( self, controlCode, bytes=[] ): + def doControl(self, controlCode, bytes=[]): """Transmit a control command to the reader and return response. controlCode: control command @@ -182,12 +189,12 @@ return: response are the response bytes (if any) """ - CardConnection.doControl( self, controlCode, bytes ) - hresult, response = SCardControl( self.hcard, controlCode, bytes ) - if hresult!=0: - raise CardConnectionException( 'Failed to control ' + SCardGetErrorMessage(hresult) ) + CardConnection.doControl(self, controlCode, bytes) + hresult, response = SCardControl(self.hcard, controlCode, bytes) + if hresult != 0: + raise CardConnectionException('Failed to control ' + SCardGetErrorMessage(hresult)) - data = map(lambda x: (x+256)%256, response) + data = map(lambda x: (x + 256) % 256, response) return data if __name__ == '__main__': @@ -197,6 +204,6 @@ from smartcard.pcsc.PCSCReader import readers cc = readers()[0].createConnection() cc.connect() - print "%r %x %x" % cc.transmit( SELECT + DF_TELECOM ) + print "%r %x %x" % cc.transmit(SELECT + DF_TELECOM) - print cc.control( 0, [] ) + print cc.control(0, []) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Ludovic R. <lud...@gm...> - 2010-06-06 14:42:12
|
2010/5/29 jean daniel aussel <jda...@gm...>: > just got your mail. > > The error parameter is in the scard wrapper (scard.error). > I think that the issue is that string exceptions are raised. I guess these > strings have to be replaced by objects. Will do it and have another release, I fixed some errors in revision 423 [1]. But I do not know what to do with: hresult = SCardIntroduceReader( hcontext, self.name, self.name ) if 0!=hresult and SCARD_E_DUPLICATE_READER!=hresult: raise error, 'Unable to introduce reader: ' + self.name + ' : ' + SCardGetErrorMessage(hresult) We can create a new exception class IntroduceReaderException() and use it (only in one unique place) or just use BaseSCardException() instead. I propose to use: raise BaseSCardException(hresult) Comments? [1] http://sourceforge.net/mailarchive/message.php?msg_name=E1OLGwm-0006XZ-I9%40sfp-svn-5.v30.ch3.sourceforge.com -- Dr. Ludovic Rousseau |
From: <lu...@us...> - 2010-06-06 14:35:38
|
Revision: 423 http://pyscard.svn.sourceforge.net/pyscard/?rev=423&view=rev Author: ludov Date: 2010-06-06 14:35:32 +0000 (Sun, 06 Jun 2010) Log Message: ----------- use EstablishContextException() and ReleaseContextException() classes instead of "raise string" which is now unsupported by Python 2.6 Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReader.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2010-06-06 14:31:05 UTC (rev 422) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2010-06-06 14:35:32 UTC (rev 423) @@ -61,7 +61,7 @@ hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if 0!=hresult: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise EstablishContextException(hresult) try: hresult = SCardIntroduceReader( hcontext, self.name, self.name ) if 0!=hresult and SCARD_E_DUPLICATE_READER!=hresult: @@ -72,7 +72,7 @@ finally: hresult = SCardReleaseContext( hcontext ) if 0!=hresult: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise ReleaseContextException(hresult) def removefromreadergroup( self, groupname ): @@ -80,7 +80,7 @@ hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if 0!=hresult: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise EstablishContextException(hresult) try: hresult = SCardRemoveReaderFromGroup( hcontext, self.name, groupname ) if hresult!=0: @@ -88,7 +88,7 @@ finally: hresult = SCardReleaseContext( hcontext ) if 0!=hresult: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise ReleaseContextException(hresult) def createConnection( self ): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 14:31:11
|
Revision: 422 http://pyscard.svn.sourceforge.net/pyscard/?rev=422&view=rev Author: ludov Date: 2010-06-06 14:31:05 +0000 (Sun, 06 Jun 2010) Log Message: ----------- EstablishContextException() use an integer argument instead of a string. The conversion to a string is done in the __str__() method Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCContext.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCContext.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2010-06-06 14:20:41 UTC (rev 421) +++ trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2010-06-06 14:31:05 UTC (rev 422) @@ -35,7 +35,7 @@ def __init__( self ): hresult, self.hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if hresult!=0: - raise EstablishContextException( 'Failed to establish context: ' + SCardGetErrorMessage(hresult) ) + raise EstablishContextException(hresult) def getContext( self ): return self.hcontext This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 14:20:47
|
Revision: 421 http://pyscard.svn.sourceforge.net/pyscard/?rev=421&view=rev Author: ludov Date: 2010-06-06 14:20:41 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Only catch BaseSCardException exceptions in the sample code Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-06-06 14:18:51 UTC (rev 420) +++ trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-06-06 14:20:41 UTC (rev 421) @@ -69,5 +69,5 @@ import sys try: raise EstablishContextException( smartcard.scard.SCARD_E_NO_MEMORY ) - except: - print sys.exc_info()[1] + except BaseSCardException as exc: + print exc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-06-06 14:18:57
|
Revision: 420 http://pyscard.svn.sourceforge.net/pyscard/?rev=420&view=rev Author: ludov Date: 2010-06-06 14:18:51 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Add smartcard.scard.SCardGetErrorMessage(self.hresult) also for a BaseSCardException representation Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-05-25 09:57:51 UTC (rev 419) +++ trunk/pyscard/src/smartcard/pcsc/PCSCExceptions.py 2010-06-06 14:18:51 UTC (rev 420) @@ -40,7 +40,8 @@ def __str__(self): """Returns a string representation of the exception.""" - return "scard exception!" + return repr("scard exception: " + + smartcard.scard.SCardGetErrorMessage(self.hresult)) class EstablishContextException(BaseSCardException): """Raised when scard failed to establish context with PCSC.""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Ludovic R. <lud...@gm...> - 2010-05-29 19:27:57
|
2010/5/29 jean daniel aussel <jda...@gm...>: > just got your mail. > > The error parameter is in the scard wrapper (scard.error). > I think that the issue is that string exceptions are raised. I guess these > strings have to be replaced by objects. Will do it and have another release, > too late for this one, regression tests passed on all OS, binary files > built, and all files and docs have been updated on the web site. I see. >From src/smartcard/scard/scard.i //---------------------------------------------------------------------- // This code is added to the scard.py python module //---------------------------------------------------------------------- %pythoncode %{ error = _scard.error %} But I do not find where _scard.error is set. Bye -- Dr. Ludovic Rousseau |
From: Ludovic R. <lud...@gm...> - 2010-05-28 14:02:38
|
Hello, >From [1] the python-pyscard Debian package has been flagged as a "packages that raise string exceptions". This mechanism is deprecated and will not work with Python 1.6. If I use pep8 on the source code I have many: W602 deprecated form of raising exception For example: ./smartcard/pcsc/PCSCReader.py:64:24: W602 deprecated form of raising exception The line is: raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) I have no idea where the "error" argument comes from. I guess the code should look like: raise EstablishContextException(hresult) Is that exact? Another example is: ./smartcard/util/__init__.py:95:24: W602 deprecated form of raising exception The line is: raise TypeError, 'not a string representing a list of bytes' I guess it should be: raise TypeError('not a string representing a list of bytes') Exact? [1] http://lists.debian.org/debian-python/2010/05/msg00111.html -- Dr. Ludovic Rousseau |
From: <jda...@us...> - 2010-05-25 09:58:01
|
Revision: 419 http://pyscard.svn.sourceforge.net/pyscard/?rev=419&view=rev Author: jdaussel Date: 2010-05-25 09:57:51 +0000 (Tue, 25 May 2010) Log Message: ----------- Tagging the 1.6.10 release of pyscard. Added Paths: ----------- tags/release-1.6.10/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2010-05-25 09:57:26
|
Revision: 418 http://pyscard.svn.sourceforge.net/pyscard/?rev=418&view=rev Author: jdaussel Date: 2010-05-25 09:57:16 +0000 (Tue, 25 May 2010) Log Message: ----------- Release 1.6.10 Modified Paths: -------------- trunk/pyscard/sourceforge/tag-it.bat Modified: trunk/pyscard/sourceforge/tag-it.bat =================================================================== --- trunk/pyscard/sourceforge/tag-it.bat 2010-05-25 09:56:17 UTC (rev 417) +++ trunk/pyscard/sourceforge/tag-it.bat 2010-05-25 09:57:16 UTC (rev 418) @@ -1,2 +1,2 @@ rem just change the release number for creating a new tag -svn copy https://pyscard.svn.sourceforge.net/svnroot/pyscard/trunk https://pyscard.svn.sourceforge.net/svnroot/pyscard/tags/release-1.6.8 -m "Tagging the 1.6.8 release of pyscard." +svn copy https://pyscard.svn.sourceforge.net/svnroot/pyscard/trunk https://pyscard.svn.sourceforge.net/svnroot/pyscard/tags/release-1.6.10 -m "Tagging the 1.6.10 release of pyscard." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2010-05-25 09:56:24
|
Revision: 417 http://pyscard.svn.sourceforge.net/pyscard/?rev=417&view=rev Author: jdaussel Date: 2010-05-25 09:56:17 +0000 (Tue, 25 May 2010) Log Message: ----------- Updated release date to May 2010 Modified Paths: -------------- trunk/pyscard/src/README trunk/pyscard/src/smartcard/ChangeLog trunk/pyscard/src/smartcard/README trunk/pyscard/src/smartcard/TODO trunk/pyscard/src/smartcard/__init__.py trunk/pyscard/src/smartcard/doc/framework-samples.html trunk/pyscard/src/smartcard/doc/index.html trunk/pyscard/src/smartcard/doc/scard-samples.html Modified: trunk/pyscard/src/README =================================================================== --- trunk/pyscard/src/README 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/README 2010-05-25 09:56:17 UTC (rev 417) @@ -23,7 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- -Last update : pyscard 1.6.10 (April 2010) +Last update : pyscard 1.6.10 (May 2010) ------------------------------------------------------------------------------- pyscard is a python module adding smart cards support to python. Modified: trunk/pyscard/src/smartcard/ChangeLog =================================================================== --- trunk/pyscard/src/smartcard/ChangeLog 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/ChangeLog 2010-05-25 09:56:17 UTC (rev 417) @@ -1,4 +1,4 @@ -1.6.10 (April 2010) +1.6.10 (May 2010) =================== * connect() has a new disposition parameter that is passed to SCardDisconnect (Ludovic Rousseau) * fixed winscard_init() bad initialization causing problems in multithreaded environment (Ludovic Rousseau) Modified: trunk/pyscard/src/smartcard/README =================================================================== --- trunk/pyscard/src/smartcard/README 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/README 2010-05-25 09:56:17 UTC (rev 417) @@ -23,7 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- -Last update : pyscard 1.6.10 (April 2010) +Last update : pyscard 1.6.10 (May 2010) ------------------------------------------------------------------------------- pyscard is a python module adding smart cards support to python. Modified: trunk/pyscard/src/smartcard/TODO =================================================================== --- trunk/pyscard/src/smartcard/TODO 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/TODO 2010-05-25 09:56:17 UTC (rev 417) @@ -8,4 +8,4 @@ - more unit tests -April 2010 +May 2010 Modified: trunk/pyscard/src/smartcard/__init__.py =================================================================== --- trunk/pyscard/src/smartcard/__init__.py 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/__init__.py 2010-05-25 09:56:17 UTC (rev 417) @@ -4,7 +4,7 @@ access smartcards and readers. __author__ = "gemalto http://www.gemalto.com" -__date__ = "April 2010" +__date__ = "May 2010" __version__ = "1.6.10" Copyright 2001-2010 gemalto Modified: trunk/pyscard/src/smartcard/doc/framework-samples.html =================================================================== --- trunk/pyscard/src/smartcard/doc/framework-samples.html 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/doc/framework-samples.html 2010-05-25 09:56:17 UTC (rev 417) @@ -12,7 +12,7 @@ secure and Free Open Source software downloads" /></a> <hr> <H1 align="center"> </h1> -Last update : pyscard 1.6.10 (April 2010) +Last update : pyscard 1.6.10 (May 2010) <p> <a href="pyscard-usersguide.html">pyscard</a> is a python module adding smart cards support to <a href="http://www.python.org">python</a>. <p>It consists of <a Modified: trunk/pyscard/src/smartcard/doc/index.html =================================================================== --- trunk/pyscard/src/smartcard/doc/index.html 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/doc/index.html 2010-05-25 09:56:17 UTC (rev 417) @@ -14,7 +14,7 @@ alt="Get pyscard at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> </h1> <hr> - Last update : pyscard 1.6.10 (April 2010) + Last update : pyscard 1.6.10 (May 2010) <p> <a href="pyscard-usersguide.html">pyscard - python smart card library</a> is a python module adding smart cards support to <a href="http://www.python.org">python.</a> Modified: trunk/pyscard/src/smartcard/doc/scard-samples.html =================================================================== --- trunk/pyscard/src/smartcard/doc/scard-samples.html 2010-05-20 07:25:05 UTC (rev 416) +++ trunk/pyscard/src/smartcard/doc/scard-samples.html 2010-05-25 09:56:17 UTC (rev 417) @@ -12,7 +12,7 @@ secure and Free Open Source software downloads" /></a> <hr> <H1 align="center"> </h1> -Last update : pyscard 1.6.10 (April 2010) +Last update : pyscard 1.6.10 (May 2010) <p>Using the <a href="epydoc/index.html">smartcard framework</a> is the preferred way to write python smart card application. You can however use the <a href="epydoc/smartcard.scard.scard-module.html">smartcard.scard</a> library to write your python smart card application if you want to write your This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: jean d. a. <jda...@gm...> - 2010-05-20 08:19:14
|
Thanks Wim, will have a close look and get back to you soon. Cheers, -jda -----Original Message----- From: Wim Lewis [mailto:wi...@hh...] Sent: Wednesday, May 19, 2010 7:54 AM To: pys...@li... Subject: Re: [Pyscard-devel] pyscard and PIV cards I tidied up some of the random dependencies and stashed a copy here: http://underhill.hhhh.org/~wiml/misc/pyscard-piv-wiml-r1.tar.bz2<http://underhill.hhhh.org/%7Ewiml/misc/pyscard-piv-wiml-r1.tar.bz2> Wim. ------------------------------ ------------------------------------------------ _______________________________________________ Pyscard-devel mailing list Pys...@li... https://lists.sourceforge.net/lists/listinfo/pyscard-devel |
From: <lu...@us...> - 2010-05-20 07:25:12
|
Revision: 416 http://pyscard.svn.sourceforge.net/pyscard/?rev=416&view=rev Author: ludov Date: 2010-05-20 07:25:05 +0000 (Thu, 20 May 2010) Log Message: ----------- add PCSCv2_PART10_PROPERTY_bPPDUSupport Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-18 15:07:22 UTC (rev 415) +++ trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-20 07:25:05 UTC (rev 416) @@ -78,6 +78,7 @@ PCSCv2_PART10_PROPERTY_bMinPINSize = 6 PCSCv2_PART10_PROPERTY_bMaxPINSize = 7 PCSCv2_PART10_PROPERTY_sFirmwareID = 8 +PCSCv2_PART10_PROPERTY_bPPDUSupport = 9 Properties = { "PCSCv2_PART10_PROPERTY_wLcdLayout" : PCSCv2_PART10_PROPERTY_wLcdLayout, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Wim L. <wi...@hh...> - 2010-05-19 06:09:02
|
I tidied up some of the random dependencies and stashed a copy here: http://underhill.hhhh.org/~wiml/misc/pyscard-piv-wiml-r1.tar.bz2 Wim. |
From: <lu...@us...> - 2010-05-18 15:07:28
|
Revision: 415 http://pyscard.svn.sourceforge.net/pyscard/?rev=415&view=rev Author: ludov Date: 2010-05-18 15:07:22 +0000 (Tue, 18 May 2010) Log Message: ----------- Update copyright date Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-18 15:06:16 UTC (rev 414) +++ trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-18 15:07:22 UTC (rev 415) @@ -2,7 +2,7 @@ __author__ = "Ludovic Rousseau" -Copyright 2009 Ludovic Rosseau +Copyright 2009-2010 Ludovic Rosseau Author: Ludovic Rousseau, mailto:lud...@fr... This file is part of pyscard. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-18 15:06:22
|
Revision: 414 http://pyscard.svn.sourceforge.net/pyscard/?rev=414&view=rev Author: ludov Date: 2010-05-18 15:06:16 +0000 (Tue, 18 May 2010) Log Message: ----------- getPinProperties() & getTlvProperties(): return a valid dictionnary even if the feature is not supported Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-15 15:03:22 UTC (rev 413) +++ trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-18 15:06:16 UTC (rev 414) @@ -146,7 +146,7 @@ controlCode = hasFeature(featureList, FEATURE_IFD_PIN_PROPERTIES) if controlCode is None: - return + return { 'raw': [] } response = cardConnection.control(controlCode, []) d = { @@ -174,7 +174,7 @@ controlCode = hasFeature(featureList, FEATURE_GET_TLV_PROPERTIES) if controlCode is None: - return + return { 'raw': [] } response = cardConnection.control(controlCode, []) d = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 15:03:29
|
Revision: 413 http://pyscard.svn.sourceforge.net/pyscard/?rev=413&view=rev Author: ludov Date: 2010-05-15 15:03:22 +0000 (Sat, 15 May 2010) Log Message: ----------- connect() in SCARD_SHARE_DIRECT mode so that it works even with no smart card inserted. We are talking to the reader/driver, not the card. Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-15 12:55:59 UTC (rev 412) +++ trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py 2010-05-15 15:03:22 UTC (rev 413) @@ -213,7 +213,7 @@ """Small sample illustrating the use of PCSCPart10.""" from smartcard.pcsc.PCSCReader import readers cc = readers()[0].createConnection() - cc.connect() + cc.connect(mode=SCARD_SHARE_DIRECT) #print cc.control( CM_IOCTL_GET_FEATURE_REQUEST ) features = getFeatureRequest(cc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 12:56:07
|
Revision: 412 http://pyscard.svn.sourceforge.net/pyscard/?rev=412&view=rev Author: ludov Date: 2010-05-15 12:55:59 +0000 (Sat, 15 May 2010) Log Message: ----------- Revert change from revision 410 now that the card name matching is fast enough Revision Links: -------------- http://pyscard.svn.sourceforge.net/pyscard/?rev=410&view=rev Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-15 12:53:38 UTC (rev 411) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 12:55:59 UTC (rev 412) @@ -22,7 +22,6 @@ import parseATR List = "/usr/local/share/pcsc/smartcard_list.txt" -Match = 0 def stress(atr_list): @@ -45,12 +44,11 @@ print e else: print txt - if Match: - card = parseATR.match_atr(atr) - if card: - print "Possibly identified card:", "\n\t".join(card) - else: - print "Unknown card" + card = parseATR.match_atr(atr) + if card: + print "Possibly identified card:", "\n\t".join(card) + else: + print "Unknown card" print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 12:53:48
|
Revision: 411 http://pyscard.svn.sourceforge.net/pyscard/?rev=411&view=rev Author: ludov Date: 2010-05-15 12:53:38 +0000 (Sat, 15 May 2010) Log Message: ----------- Use the RE engine only when needed. Speed gain: x5 Modified Paths: -------------- trunk/contrib/parseATR/parseATR.py Modified: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py 2010-05-15 12:15:08 UTC (rev 410) +++ trunk/contrib/parseATR/parseATR.py 2010-05-15 12:53:38 UTC (rev 411) @@ -735,13 +735,23 @@ card = [] atr = toHexString(normalize(atr)) file = open(atr_file) + + # find a . * or [ in the ATR to know if we must use a RE or not + re_match = re.compile("[\\.\\*\\[]") + for line in file: if line.startswith("#") or line.startswith("\t") or line == "\n": continue line = line.rstrip("\n") - pattern = re.compile(line) - if pattern.match(atr): + # does the ATR in the file uses a RE? + if re_match.search(line): + # use the RE engine (slow) + found = re.match(line, atr) + else: + # use string compare (fast) + found = line == atr + if found: # found the ATR if atr != line: card.append("") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |