From: <lu...@us...> - 2009-06-08 15:26:36
|
Revision: 285 http://pyscard.svn.sourceforge.net/pyscard/?rev=285&view=rev Author: ludov Date: 2009-06-08 13:36:32 +0000 (Mon, 08 Jun 2009) Log Message: ----------- do not establish a PCSC context at loading but only when needed It is now possible to use, for example, smartcard.util.toHexString() even if pcscd is not started (default on Mac OS X with no reader) Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReader.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2009-06-08 13:28:49 UTC (rev 284) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2009-06-08 13:36:32 UTC (rev 285) @@ -31,9 +31,7 @@ from smartcard.pcsc.PCSCExceptions import * from smartcard.scard import * -hcontext = PCSCContext().getContext() - -def __PCSCreaders__( 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. @@ -102,7 +100,9 @@ def readers( groups=[] ): creaders=[] - for reader in __PCSCreaders__( groups ): + hcontext = PCSCContext().getContext() + + for reader in __PCSCreaders__( hcontext, groups ): creaders.append( ReaderFactory.createReader( 'smartcard.pcsc.PCSCReader.PCSCReader', reader ) ) return creaders This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |