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: SourceForge.net <no...@so...> - 2011-10-19 12:50:11
|
Feature Requests item #3110077, was opened at 2010-11-16 13:10 Message generated for change (Comment added) made by ludov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957075&aid=3110077&group_id=196342 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interface Improvements (example) Group: Next Release (example) Status: Closed Priority: 5 Private: No Submitted By: chrysn () Assigned to: jean-daniel aussel (jdaussel) Summary: new style classes Initial Comment: since version 2.2, python has "new style classes", which unify types and classes. they provide more flexibility for getters and setters and better support for the super call, among other features. i suggest to change pyscard classes into new style classes by changing the definitions from "class Observer:" to "class Observer(object):". the classes this affects can be found using `grep '^class .*[^)]:' . -r`. (by the way, that list includes SWException, which i assume from the name should derive from Exception.) ---------------------------------------------------------------------- >Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 14:50 Message: Partly reverted in revision 572. Maybe you can help solve the problem. The error is: File "/Library/Python/2.7/site-packages/smartcard/__init__.py", line 34, in <module> from smartcard.System import listReaders File "/Library/Python/2.7/site-packages/smartcard/System.py", line 27, in <module> import smartcard.reader.ReaderFactory File "/Library/Python/2.7/site-packages/smartcard/reader/ReaderFactory.py", line 34, in <module> from smartcard.pcsc.PCSCReader import PCSCReader File "/Library/Python/2.7/site-packages/smartcard/pcsc/PCSCReader.py", line 25, in <module> from smartcard.CardConnectionDecorator import CardConnectionDecorator File "/Library/Python/2.7/site-packages/smartcard/CardConnectionDecorator.py", line 27, in <module> from smartcard.CardConnection import CardConnection File "/Library/Python/2.7/site-packages/smartcard/CardConnection.py", line 28, in <module> from smartcard.Observer import Observer File "/Library/Python/2.7/site-packages/smartcard/Observer.py", line 81, in <module> "countObservers") File "/Library/Python/2.7/site-packages/smartcard/Synchronization.py", line 36, in synchronize klass.__dict__[name] = synchronized(val) TypeError: 'dictproxy' object does not support item assignment ---------------------------------------------------------------------- Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 14:26 Message: This is now fixed in revision 571 http://pyscard.svn.sourceforge.net/viewvc/pyscard?view=revision&revision=571 Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957075&aid=3110077&group_id=196342 |
From: <lu...@us...> - 2011-10-19 12:47:36
|
Revision: 572 http://pyscard.svn.sourceforge.net/pyscard/?rev=572&view=rev Author: ludov Date: 2011-10-19 12:47:30 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Partly revert revision 571 because of side effect The error is: File "/Library/Python/2.7/site-packages/smartcard/__init__.py", line 34, in <module> from smartcard.System import listReaders File "/Library/Python/2.7/site-packages/smartcard/System.py", line 27, in <module> import smartcard.reader.ReaderFactory File "/Library/Python/2.7/site-packages/smartcard/reader/ReaderFactory.py", line 34, in <module> from smartcard.pcsc.PCSCReader import PCSCReader File "/Library/Python/2.7/site-packages/smartcard/pcsc/PCSCReader.py", line 25, in <module> from smartcard.CardConnectionDecorator import CardConnectionDecorator File "/Library/Python/2.7/site-packages/smartcard/CardConnectionDecorator.py", line 27, in <module> from smartcard.CardConnection import CardConnection File "/Library/Python/2.7/site-packages/smartcard/CardConnection.py", line 28, in <module> from smartcard.Observer import Observer File "/Library/Python/2.7/site-packages/smartcard/Observer.py", line 81, in <module> "countObservers") File "/Library/Python/2.7/site-packages/smartcard/Synchronization.py", line 36, in synchronize klass.__dict__[name] = synchronized(val) TypeError: 'dictproxy' object does not support item assignment Revision Links: -------------- http://pyscard.svn.sourceforge.net/pyscard/?rev=571&view=rev Modified Paths: -------------- trunk/pyscard/src/smartcard/Synchronization.py Modified: trunk/pyscard/src/smartcard/Synchronization.py =================================================================== --- trunk/pyscard/src/smartcard/Synchronization.py 2011-10-19 12:25:28 UTC (rev 571) +++ trunk/pyscard/src/smartcard/Synchronization.py 2011-10-19 12:47:30 UTC (rev 572) @@ -36,7 +36,7 @@ klass.__dict__[name] = synchronized(val) -class Synchronization(object): +class Synchronization: # You can create your own self.mutex, or inherit from this class: def __init__(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2011-10-19 12:26:56
|
Feature Requests item #3110077, was opened at 2010-11-16 13:10 Message generated for change (Comment added) made by ludov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957075&aid=3110077&group_id=196342 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interface Improvements (example) Group: Next Release (example) >Status: Closed Priority: 5 Private: No Submitted By: chrysn () Assigned to: jean-daniel aussel (jdaussel) Summary: new style classes Initial Comment: since version 2.2, python has "new style classes", which unify types and classes. they provide more flexibility for getters and setters and better support for the super call, among other features. i suggest to change pyscard classes into new style classes by changing the definitions from "class Observer:" to "class Observer(object):". the classes this affects can be found using `grep '^class .*[^)]:' . -r`. (by the way, that list includes SWException, which i assume from the name should derive from Exception.) ---------------------------------------------------------------------- >Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 14:26 Message: This is now fixed in revision 571 http://pyscard.svn.sourceforge.net/viewvc/pyscard?view=revision&revision=571 Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957075&aid=3110077&group_id=196342 |
From: <lu...@us...> - 2011-10-19 12:25:38
|
Revision: 571 http://pyscard.svn.sourceforge.net/pyscard/?rev=571&view=rev Author: ludov Date: 2011-10-19 12:25:28 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Make all classes inherit from the object class instead of nothing Closes Feature Request 3110077 "new style classes" https://sourceforge.net/tracker/?func=detail&aid=3110077&group_id=196342&atid=957075 Modified Paths: -------------- trunk/pyscard/src/smartcard/ATR.py trunk/pyscard/src/smartcard/AbstractCardRequest.py trunk/pyscard/src/smartcard/Card.py trunk/pyscard/src/smartcard/CardConnectionEvent.py trunk/pyscard/src/smartcard/CardMonitoring.py trunk/pyscard/src/smartcard/CardNames.py trunk/pyscard/src/smartcard/CardRequest.py trunk/pyscard/src/smartcard/CardService.py trunk/pyscard/src/smartcard/CardType.py trunk/pyscard/src/smartcard/Observer.py trunk/pyscard/src/smartcard/Session.py trunk/pyscard/src/smartcard/Synchronization.py trunk/pyscard/src/smartcard/pcsc/PCSCContext.py trunk/pyscard/src/smartcard/pyro/server/PyroDaemon.py trunk/pyscard/src/smartcard/reader/Reader.py trunk/pyscard/src/smartcard/reader/ReaderFactory.py trunk/pyscard/src/smartcard/reader/ReaderGroups.py trunk/pyscard/src/smartcard/sw/ErrorChecker.py trunk/pyscard/src/smartcard/sw/ErrorCheckingChain.py trunk/pyscard/src/smartcard/sw/SWExceptions.py trunk/pyscard/src/smartcard/wx/SimpleSCardAppEventObserver.py Modified: trunk/pyscard/src/smartcard/ATR.py =================================================================== --- trunk/pyscard/src/smartcard/ATR.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/ATR.py 2011-10-19 12:25:28 UTC (rev 571) @@ -25,7 +25,7 @@ from smartcard.Exceptions import SmartcardException -class ATR: +class ATR(object): """ATR class.""" clockrateconversion = [372, 372, 558, 744, 1116, 1488, 1860, 'RFU', Modified: trunk/pyscard/src/smartcard/AbstractCardRequest.py =================================================================== --- trunk/pyscard/src/smartcard/AbstractCardRequest.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/AbstractCardRequest.py 2011-10-19 12:25:28 UTC (rev 571) @@ -27,7 +27,7 @@ import smartcard.System -class AbstractCardRequest: +class AbstractCardRequest(object): """The base class for xxxCardRequest classes. A CardRequest is used for waitForCard() invocations and specifies what Modified: trunk/pyscard/src/smartcard/Card.py =================================================================== --- trunk/pyscard/src/smartcard/Card.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/Card.py 2011-10-19 12:25:28 UTC (rev 571) @@ -27,7 +27,7 @@ from smartcard.util import toHexString -class Card: +class Card(object): """Card class.""" def __init__(self, reader, atr): Modified: trunk/pyscard/src/smartcard/CardConnectionEvent.py =================================================================== --- trunk/pyscard/src/smartcard/CardConnectionEvent.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardConnectionEvent.py 2011-10-19 12:25:28 UTC (rev 571) @@ -24,7 +24,7 @@ """ -class CardConnectionEvent: +class CardConnectionEvent(object): """Base class for card connection events. This event is notified by CardConnection objects. Modified: trunk/pyscard/src/smartcard/CardMonitoring.py =================================================================== --- trunk/pyscard/src/smartcard/CardMonitoring.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardMonitoring.py 2011-10-19 12:25:28 UTC (rev 571) @@ -63,7 +63,7 @@ pass -class CardMonitor: +class CardMonitor(object): """Class that monitors smart card insertion/removal. and notify observers @@ -130,7 +130,7 @@ return getattr(self.instance, name) -class CardMonitoringThread: +class CardMonitoringThread(object): """Card insertion thread. This thread waits for card insertion. """ Modified: trunk/pyscard/src/smartcard/CardNames.py =================================================================== --- trunk/pyscard/src/smartcard/CardNames.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardNames.py 2011-10-19 12:25:28 UTC (rev 571) @@ -74,7 +74,7 @@ synchronize(__CardNames__, "add delete dump find") -class CardNames: +class CardNames(object): """The CardNames organizes cards by a unique name and an associated smartcard.CardType.CardType.""" Modified: trunk/pyscard/src/smartcard/CardRequest.py =================================================================== --- trunk/pyscard/src/smartcard/CardRequest.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardRequest.py 2011-10-19 12:25:28 UTC (rev 571) @@ -25,7 +25,7 @@ from smartcard.pcsc.PCSCCardRequest import PCSCCardRequest -class CardRequest: +class CardRequest(object): """A CardRequest is used for waitForCard() invocations and specifies what kind of smart card an application is waited for. """ Modified: trunk/pyscard/src/smartcard/CardService.py =================================================================== --- trunk/pyscard/src/smartcard/CardService.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardService.py 2011-10-19 12:25:28 UTC (rev 571) @@ -34,7 +34,7 @@ from smartcard.scard import * -class CardService: +class CardService(object): """Card service abstract class. Known subclasses: smartcard.PassThruCardService """ Modified: trunk/pyscard/src/smartcard/CardType.py =================================================================== --- trunk/pyscard/src/smartcard/CardType.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/CardType.py 2011-10-19 12:25:28 UTC (rev 571) @@ -25,7 +25,7 @@ from smartcard.util import toHexString -class CardType: +class CardType(object): """Abstract base class for CardTypes. Known sub-classes: smartcard.CardType.AnyCardType Modified: trunk/pyscard/src/smartcard/Observer.py =================================================================== --- trunk/pyscard/src/smartcard/Observer.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/Observer.py 2011-10-19 12:25:28 UTC (rev 571) @@ -15,7 +15,7 @@ from smartcard.Synchronization import * -class Observer: +class Observer(object): def update(observable, arg): '''Called when the observed object is Modified: trunk/pyscard/src/smartcard/Session.py =================================================================== --- trunk/pyscard/src/smartcard/Session.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/Session.py 2011-10-19 12:25:28 UTC (rev 571) @@ -29,7 +29,7 @@ from smartcard.System import readers -class Session: +class Session(object): """The Session object enables programmers to transmit APDU to smartcards. This is an example of use of the Session object: Modified: trunk/pyscard/src/smartcard/Synchronization.py =================================================================== --- trunk/pyscard/src/smartcard/Synchronization.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/Synchronization.py 2011-10-19 12:25:28 UTC (rev 571) @@ -36,7 +36,7 @@ klass.__dict__[name] = synchronized(val) -class Synchronization: +class Synchronization(object): # You can create your own self.mutex, or inherit from this class: def __init__(self): Modified: trunk/pyscard/src/smartcard/pcsc/PCSCContext.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/pcsc/PCSCContext.py 2011-10-19 12:25:28 UTC (rev 571) @@ -28,7 +28,7 @@ from smartcard.pcsc.PCSCExceptions import EstablishContextException -class PCSCContext: +class PCSCContext(object): """Manage a singleton pcsc context handle.""" class __PCSCContextSingleton: Modified: trunk/pyscard/src/smartcard/pyro/server/PyroDaemon.py =================================================================== --- trunk/pyscard/src/smartcard/pyro/server/PyroDaemon.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/pyro/server/PyroDaemon.py 2011-10-19 12:25:28 UTC (rev 571) @@ -30,7 +30,7 @@ import Pyro.naming -class PyroDaemon: +class PyroDaemon(object): """Singleton class to wrap the pyro daemon.""" class _PyroDaemon: Modified: trunk/pyscard/src/smartcard/reader/Reader.py =================================================================== --- trunk/pyscard/src/smartcard/reader/Reader.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/reader/Reader.py 2011-10-19 12:25:28 UTC (rev 571) @@ -23,7 +23,7 @@ """ -class Reader: +class Reader(object): """Reader abstract class. The reader class is responsible for creating connections Modified: trunk/pyscard/src/smartcard/reader/ReaderFactory.py =================================================================== --- trunk/pyscard/src/smartcard/reader/ReaderFactory.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/reader/ReaderFactory.py 2011-10-19 12:25:28 UTC (rev 571) @@ -34,7 +34,7 @@ from smartcard.pcsc.PCSCReader import PCSCReader -class ReaderFactory: +class ReaderFactory(object): """Class to create readers from reader type id.""" factories = {} Modified: trunk/pyscard/src/smartcard/reader/ReaderGroups.py =================================================================== --- trunk/pyscard/src/smartcard/reader/ReaderGroups.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/reader/ReaderGroups.py 2011-10-19 12:25:28 UTC (rev 571) @@ -91,7 +91,7 @@ pass -class readergroups: +class readergroups(object): """ReadersGroups organizes smart card reader as groups.""" """The single instance of __readergroups""" Modified: trunk/pyscard/src/smartcard/sw/ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ErrorChecker.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/sw/ErrorChecker.py 2011-10-19 12:25:28 UTC (rev 571) @@ -23,7 +23,7 @@ """ -class ErrorChecker: +class ErrorChecker(object): """Base class for status word error checking strategies. Error checking strategies are chained into an L{ErrorCheckingChain} to Modified: trunk/pyscard/src/smartcard/sw/ErrorCheckingChain.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ErrorCheckingChain.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/sw/ErrorCheckingChain.py 2011-10-19 12:25:28 UTC (rev 571) @@ -26,7 +26,7 @@ from sys import exc_info -class ErrorCheckingChain: +class ErrorCheckingChain(object): """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 L{smartcard.sw.SWException} Modified: trunk/pyscard/src/smartcard/sw/SWExceptions.py =================================================================== --- trunk/pyscard/src/smartcard/sw/SWExceptions.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/sw/SWExceptions.py 2011-10-19 12:25:28 UTC (rev 571) @@ -25,7 +25,7 @@ """ -class SWException: +class SWException(Exception): """Base class for status word exceptions. Status word exceptions are generated when errors and warnings are detected Modified: trunk/pyscard/src/smartcard/wx/SimpleSCardAppEventObserver.py =================================================================== --- trunk/pyscard/src/smartcard/wx/SimpleSCardAppEventObserver.py 2011-10-19 12:10:58 UTC (rev 570) +++ trunk/pyscard/src/smartcard/wx/SimpleSCardAppEventObserver.py 2011-10-19 12:25:28 UTC (rev 571) @@ -23,7 +23,7 @@ """ -class SimpleSCardAppEventObserver: +class SimpleSCardAppEventObserver(object): """This interface defines the event handlers called by the SimpleSCardApp.""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2011-10-19 12:11:37
|
Support Requests item #3163588, was opened at 2011-01-21 21:20 Message generated for change (Comment added) made by ludov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957073&aid=3163588&group_id=196342 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Private: No Submitted By: Andrew Elwell (elwell2000) Assigned to: Nobody/Anonymous (nobody) Summary: Licence Clarification Initial Comment: Hi, I've been trying to bundle pyscard for Fedora (see https://bugzilla.redhat.com/show_bug.cgi?id=663102 ) however, during the package review some licence issues were uncovered. Basically: smartcard/ClassLoader.py smartcard/Observer.py smartcard/Synchronization.py smartcard/scard/pyscard-reader.h Don't seem to be covered under the same licence - have you had any correspondence with the original authors about them? Many thanks for any input you can provide -- see the bugzilla ticket (comment #9) for more info. Andrew ---------------------------------------------------------------------- >Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 14:11 Message: Problem now fixed for the file smartcard/scard/pyscard-reader.h ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957073&aid=3163588&group_id=196342 |
From: <lu...@us...> - 2011-10-19 12:11:05
|
Revision: 570 http://pyscard.svn.sourceforge.net/pyscard/?rev=570&view=rev Author: ludov Date: 2011-10-19 12:10:58 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Use the same licence as the pyscard project See Support Requests 3163588 "Licence Clarification" https://sourceforge.net/tracker/?func=detail&aid=3163588&group_id=196342&atid=957073 Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/pyscard-reader.h Modified: trunk/pyscard/src/smartcard/scard/pyscard-reader.h =================================================================== --- trunk/pyscard/src/smartcard/scard/pyscard-reader.h 2011-10-16 18:42:02 UTC (rev 569) +++ trunk/pyscard/src/smartcard/scard/pyscard-reader.h 2011-10-19 12:10:58 UTC (rev 570) @@ -1,12 +1,31 @@ /*============================================================================== -This file contains SCARD_ATTR attributes definitions taken from reader.h, in -MUSCLE SmartCard Development ( http://www.linuxnet.com ). It allows to -build pyscard on Mac OS X without any dependency on the muscle source code. -Indeed, default Mac OS X does not containt reader.h as part of the PCSC.framework. +This file contains SCARD_ATTR attributes definitions taken from +reader.h, in MUSCLE SmartCard Development ( http://www.linuxnet.com ). +It allows to build pyscard on Mac OS X without any dependency on the +muscle source code. Indeed, default Mac OS X does not containt reader.h +as part of the PCSC.framework. Copyright (C) 1999-2005 David Corcoran <cor...@li...> Copyright (C) 1999-2009 Ludovic Rousseau <lud...@fr...> -================================================================================ + +The licence of reader.h pcsc-lite is 3-clauses BSD and can be relicenced +in LGPL v2+ for pyscard. + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ==============================================================================*/ #define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 18:42:09
|
Revision: 569 http://pyscard.svn.sourceforge.net/pyscard/?rev=569&view=rev Author: jdaussel Date: 2011-10-16 18:42:02 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Added MacOS X Lion Installation instructions Modified Paths: -------------- trunk/pyscard/src/smartcard/README Modified: trunk/pyscard/src/smartcard/README =================================================================== --- trunk/pyscard/src/smartcard/README 2011-10-16 18:40:42 UTC (rev 568) +++ trunk/pyscard/src/smartcard/README 2011-10-16 18:42:02 UTC (rev 569) @@ -10,17 +10,18 @@ This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 2.1 of the License, or (at your option) any -later version. +the terms of the GNU Lesser General Public License as published by the +Free Software Foundation; either version 2.1 of the License, or (at your +option) any later version. -pyscard is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +pyscard is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. -You should have received a copy of the GNU Lesser General Public License along -with pyscard; if not, write to the Free Software Foundation, Inc., 51 -Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- Last update : pyscard 1.6.14 (October 2011) @@ -28,27 +29,28 @@ pyscard is a python module adding smart cards support to python. -It consists of the smartcard.scard module, an extension module wrapping Windows -smart card base components (also known as PCSC) on Windows, and PCSC lite on -linux and Mac OS X Tiger, and of the smartcard module, a python framework with -objects wrapping PCSC API. +It consists of the smartcard.scard module, an extension module wrapping +Windows smart card base components (also known as PCSC) on Windows, and +PCSC lite on linux and Mac OS X Tiger, and of the smartcard module, a +python framework with objects wrapping PCSC API. ------------------------------------------------------------------------------- Documentation ------------------------------------------------------------------------------- -All documentation is provided in the smartcard/doc directory of the source -distribution. Examples are provided in the smartcard/Examples directory of the -source distribution. The binary distribution does not include any -documentation, tests scripts or examples. +All documentation is provided in the smartcard/doc directory of the +source distribution. Examples are provided in the smartcard/Examples +directory of the source distribution. The binary distribution does not +include any documentation, tests scripts or examples. ------------------------------------------------------------------------------- Installation ------------------------------------------------------------------------------- -The pyscard library is packaged using the standard distutils python module. +The pyscard library is packaged using the standard distutils python +module. Installation on windows ----------------------- @@ -59,8 +61,8 @@ 1. download the binary msi installer or self-executable installer 2. execute the installer -The binary msi installer and self-executable installer are packaged for a -specific version of python, and have name similar to +The binary msi installer and self-executable installer are packaged for +a specific version of python, and have name similar to pyscard-1.6.14.win32-py2.5.msi and pyscard-1.6.14.win32-py2.5.exe for python 2.5. @@ -70,10 +72,10 @@ 1. you will need swig 1.3.31 from http://www.swig.org, and a C compiler. -By default, Visual Studio 2003 is required for building the c language wrapper -for python 2.5, and Visual Studio .Net or VisualC++ 6 for python 2.4. You might -use another release by fiddling with the python/Lib/distutils/msvccompiler.py -file that detects the compiler. +By default, Visual Studio 2003 is required for building the c language +wrapper for python 2.5, and Visual Studio .Net or VisualC++ 6 for python +2.4. You might use another release by fiddling with the +python/Lib/distutils/msvccompiler.py file that detects the compiler. 2. download the source distribution @@ -99,8 +101,8 @@ 1. download the binary distribution The binary distribution is either an archive file or a rpm file, with -names similar to pyscard-1.6.14-1.i386.rpm for the rpm distribution, -or pyscard-1.6.14.linux-i686.tar.gz for the archive distribution. +names similar to pyscard-1.6.14-1.i386.rpm for the rpm distribution, or +pyscard-1.6.14.linux-i686.tar.gz for the archive distribution. 2. untar the binary distribution @@ -125,14 +127,15 @@ /usr/bin/python setup.py build_ext install This will build pyscard and install it in the site-packages directory of -your python distribution, e.g. /usr/lib/python2.4/site-packages/smartcard. +your python distribution, e.g. +/usr/lib/python2.4/site-packages/smartcard. Installation on Max OS X Tiger: -------------------------------- -The Mac OS X Tiger support is experimental on pyscard 1.6.14. It was developed -and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a -ppc MacBook. +The Mac OS X Tiger support is experimental on pyscard 1.6.14. It was +developed and tested on a i386 MacBook Pro. Please drop me a mail if you +succeed on a ppc MacBook. Installing on Mac OS X Tiger from the binary distribution: ---------------------------------------------------- @@ -140,20 +143,22 @@ 1. download the binary distribution The binary distribution is an archive file, with a name similar to -pyscard-1.6.14-py-2.3-macosx10.4.mpkg or pyscard-1.6.14-py-2.5-macosx10.4.mpkg. +pyscard-1.6.14-py-2.3-macosx10.4.mpkg or +pyscard-1.6.14-py-2.5-macosx10.4.mpkg. 2. Open the package and proceed with installation. -Python 2.3 is pre-installed, so install pyscard-1.6.14-py-2.3-macosx10.4.mpkg if -you did not install another release of python. +Python 2.3 is pre-installed, so install +pyscard-1.6.14-py-2.3-macosx10.4.mpkg if you did not install another +release of python. Install pyscard-1.6.14-py-2.5-macosx10.4.mpkg if you installed python 2.5. Installing on Mac OS X Tiger from the source distribution ---------------------------------------------------------- -1. you will need swig 1.3.31 (http://www.swig.org); gcc and pcsc-lite are available -out of the box on Max OS X Tiger +1. you will need swig 1.3.31 (http://www.swig.org); gcc and pcsc-lite +are available out of the box on Max OS X Tiger 2. download the source distribution @@ -166,17 +171,14 @@ sudo python setup.py build_ext install -This will build pyscard and install it in the site-packages directory of your python distribution, e.g. +This will build pyscard and install it in the site-packages directory of +your python distribution, e.g. /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib/site-packages/smartcard Installation on Max OS X Leopard: --------------------------------- -The Mac OS X Leopard support is experimental on pyscard 1.6.14. It was developed -and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a -ppc MacBook. - Installing on Mac OS X Leopard from the binary distribution: ---------------------------------------------------- @@ -190,8 +192,8 @@ Installing on Mac OS X Leopard from the source distribution ------------------------------------------------------------ -1. you will need swig 1.3.31 (http://www.swig.org); gcc and pcsc-lite are available -out of the box on Max OS X Leopard +1. you will need swig 1.3.31 (http://www.swig.org); gcc and pcsc-lite +are available out of the box on Max OS X Leopard 2. download the source distribution @@ -204,18 +206,53 @@ sudo python setup.py build_ext install -This will build pyscard and install it in the site-packages directory of your python distribution, e.g. +This will build pyscard and install it in the site-packages directory of +your python distribution, e.g. /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.3/lib/site-packages/smartcard +Installation on Max OS X Lion: +------------------------------ + +Installing on Mac OS X Lion from the binary distribution: +---------------------------=====------------------------- + +1. download the binary distribution + +The binary distribution is an archive file, with a name similar to +pyscard-1.6.14-py-2.7-macosx10.7.mpkg. + +2. Open the package and proceed with installation. + +Installing on Mac OS X Lion from the source distribution +-------------------------------------------------------- + +1. you will need swig 1.3.31 or later (http://www.swig.org); gcc and pcsc-lite +are available out of the box on Max OS X Leopard + +2. download the source distribution + +The source distribution is available as pyscard-1.6.14.zip or +pyscard-1.6.14.tar.gz. + +3. untar or unzip the source distribution + +4. from a terminal, type the following: + +sudo python setup.py build_ext install + +This will build pyscard and install it in the site-packages directory of +your python distribution, e.g. /Library/Python/2.7/lib/site-packages/smartcard + + ------------------------------------------------------------------------------- Developer documentation, unit tests and examples ------------------------------------------------------------------------------- -The developer documentation is in the smartcard/doc directory of the source -distribution. +The developer documentation is in the smartcard/doc directory of the +source distribution. -Examples are located in the smartcard/Examples directory, and the pyunit unit -tests in the smartcard/test directory. +Examples are located in the smartcard/Examples directory, and the pyunit +unit tests in the smartcard/test directory. ------------------------------------------------------------------------------- Build instructions for packagers @@ -224,18 +261,18 @@ Building a binary distribution for Windows ------------------------------------------ -To build a binary distribution from the source distribution, you will need a C -compiler and swig 1.3.31 (same requirements as for installing from the source -distribution). +To build a binary distribution from the source distribution, you will +need a C compiler and swig 1.3.31 (same requirements as for installing +from the source distribution). -In the root directory of the source distribution, execute the following command -in a console: +In the root directory of the source distribution, execute the following +command in a console: setup.py build_ext bdist_msi setup.py build_ext bdist_wininst -This will build the msi installer and self-executable installer in the dist -directory, with names similar to pyscard-1.6.14.win32-py2.5.msi and +This will build the msi installer and self-executable installer in the +dist directory, with names similar to pyscard-1.6.14.win32-py2.5.msi and pyscard-1.6.14.win32-py2.5.exe for python 2.5, and pyscard-1.6.14.win32-py2.4.msi and pyscard-1.6.14.win32-py2.4.exe for python 2.4. @@ -243,9 +280,9 @@ Building a binary distribution for linux ---------------------------------------- -To build a binary distribution from the source distribution, you will need -gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the -source distribution). +To build a binary distribution from the source distribution, you will +need gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing +from the source distribution). In the root directory of the source distribution, execute the following command in a terminal: @@ -259,8 +296,8 @@ ---------------------------------------- To build a rpm distribution from the source distribution, you will need -gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the -source distribution). +gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from +the source distribution). In the root directory of the source distribution, execute the following command in a terminal: @@ -279,14 +316,15 @@ Building a binary distribution for Mac OS X Tiger ------------------------------------------------- -To build a binary distribution from the source distribution, you will need -swig 1.3.31 (same requirements as for installing from the source distribution) -and bdist_mpkg 0.4.3 (http://cheeseshop.python.org/pypi/bdist_mpkg/). +To build a binary distribution from the source distribution, you will +need swig 1.3.31 (same requirements as for installing from the source +distribution) and bdist_mpkg 0.4.3 +(http://cheeseshop.python.org/pypi/bdist_mpkg/). -If you are using the pre-installed python 2.3 distribution, in the root directory -of the source distribution, i.e. in the src directory, execute the following commands -in a terminal: +If you are using the pre-installed python 2.3 distribution, in the root +directory of the source distribution, i.e. in the src directory, execute +the following commands in a terminal: python setup.py build_ext /System/Library/Frameworks/Python.Framework/Versions/2.3/bin/bdist_mpkg setup.py @@ -305,9 +343,10 @@ Building a binary distribution for Mac OS X Leopard --------------------------------------------------- -To build a binary distribution from the source distribution, you will need -swig 1.3.31 (same requirements as for installing from the source distribution) -and bdist_mpkg 0.4.3 (http://cheeseshop.python.org/pypi/bdist_mpkg/). +To build a binary distribution from the source distribution, you will +need swig 1.3.31 (same requirements as for installing from the source +distribution) and bdist_mpkg 0.4.3 +(http://cheeseshop.python.org/pypi/bdist_mpkg/). Apply the following patch to tools.py of bdist_mpkg package: @@ -336,14 +375,16 @@ + raise ValueError('group %s not found' % (name,)) ===== patch end ======== -This patch is required since Mac OS X Leopard does not have the nidump command any more. +This patch is required since Mac OS X Leopard does not have the nidump +command any more. -Install bdist_mpkg by executing the bdist_mpkg setup.py script with build and -install as arguments, i.e. from the root directory of the bdist_mpkg -source distribution enter: python setup.py build install. +Install bdist_mpkg by executing the bdist_mpkg setup.py script with +build and install as arguments, i.e. from the root directory of the +bdist_mpkg source distribution enter: python setup.py build install. -For python 2.5, from the root directory of the pyscard source distribution, -i.e. in the src directory, execute the following commands in a terminal: +For python 2.5, from the root directory of the pyscard source +distribution, i.e. in the src directory, execute the following commands +in a terminal: python setup.py build_ext /Library/Frameworks/Python.Framework/Versions/2.5/Extras/bin/bdist_mpkg setup.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 18:40:49
|
Revision: 568 http://pyscard.svn.sourceforge.net/pyscard/?rev=568&view=rev Author: jdaussel Date: 2011-10-16 18:40:42 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Added MacOS X Install instructions Modified Paths: -------------- trunk/pyscard/src/README Modified: trunk/pyscard/src/README =================================================================== --- trunk/pyscard/src/README 2011-10-16 18:38:12 UTC (rev 567) +++ trunk/pyscard/src/README 2011-10-16 18:40:42 UTC (rev 568) @@ -179,10 +179,6 @@ Installation on Max OS X Leopard: --------------------------------- -The Mac OS X Leopard support is experimental on pyscard 1.6.14. It was -developed and tested on a i386 MacBook Pro. Please drop me a mail if you -succeed on a ppc MacBook. - Installing on Mac OS X Leopard from the binary distribution: ---------------------------------------------------- @@ -215,6 +211,40 @@ /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.3/lib/site-packages/smartcard +Installation on Max OS X Lion: +------------------------------ + +Installing on Mac OS X Lion from the binary distribution: +---------------------------=====------------------------- + +1. download the binary distribution + +The binary distribution is an archive file, with a name similar to +pyscard-1.6.14-py-2.7-macosx10.7.mpkg. + +2. Open the package and proceed with installation. + +Installing on Mac OS X Lion from the source distribution +-------------------------------------------------------- + +1. you will need swig 1.3.31 or later (http://www.swig.org); gcc and pcsc-lite +are available out of the box on Max OS X Leopard + +2. download the source distribution + +The source distribution is available as pyscard-1.6.14.zip or +pyscard-1.6.14.tar.gz. + +3. untar or unzip the source distribution + +4. from a terminal, type the following: + +sudo python setup.py build_ext install + +This will build pyscard and install it in the site-packages directory of +your python distribution, e.g. /Library/Python/2.7/lib/site-packages/smartcard + + ------------------------------------------------------------------------------- Developer documentation, unit tests and examples ------------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 18:38:18
|
Revision: 567 http://pyscard.svn.sourceforge.net/pyscard/?rev=567&view=rev Author: jdaussel Date: 2011-10-16 18:38:12 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed bad string spanning over two lines Modified Paths: -------------- trunk/pyscard/src/smartcard/wx/ReaderToolbar.py Modified: trunk/pyscard/src/smartcard/wx/ReaderToolbar.py =================================================================== --- trunk/pyscard/src/smartcard/wx/ReaderToolbar.py 2011-10-16 15:09:16 UTC (rev 566) +++ trunk/pyscard/src/smartcard/wx/ReaderToolbar.py 2011-10-16 18:38:12 UTC (rev 567) @@ -95,8 +95,7 @@ self.AddSeparator() self.AddSimpleTool( 20, - bmpCard, " - Connect to smartcard", + bmpCard, "Connect to smartcard", "Connect to smart card") self.AddSeparator() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 15:09:22
|
Revision: 566 http://pyscard.svn.sourceforge.net/pyscard/?rev=566&view=rev Author: jdaussel Date: 2011-10-16 15:09:16 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E261 pep8 at least two spaces before inline comment Modified Paths: -------------- trunk/contrib/parseATR/parseATR.py Modified: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py 2011-10-16 15:07:32 UTC (rev 565) +++ trunk/contrib/parseATR/parseATR.py 2011-10-16 15:09:16 UTC (rev 566) @@ -625,7 +625,7 @@ (lcs, sw1, sw2) = status[:3] text.append(" Mandatory status indicator (3 last bytes)\n") text.append(" LCS (life card cycle): %d (%s)\n" % (lcs, life_cycle_status(lcs))) - text.append(" SW: %02X%02X (%s)" % (sw1, sw2, "")) #Chipcard::PCSC::Card::ISO7816Error("$sw1 $sw2")) + text.append(" SW: %02X%02X (%s)" % (sw1, sw2, "")) # Chipcard::PCSC::Card::ISO7816Error("$sw1 $sw2")) elif hb_category == 0x80: text.append(" (compact TLV data object)\n") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 15:07:38
|
Revision: 565 http://pyscard.svn.sourceforge.net/pyscard/?rev=565&view=rev Author: jdaussel Date: 2011-10-16 15:07:32 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E251 pep8 no spaces around keyword / parameter equals Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 15:03:28 UTC (rev 564) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 15:07:32 UTC (rev 565) @@ -35,10 +35,7 @@ ICO_SMARTCARD, ICO_READER])] -setup(windows= ['apdumanager.py'], - data_files = Mydata_files, - options = - { - "py2exe": {"dll_excludes": ["MSVCP90.dll"]} - } +setup(windows=['apdumanager.py'], + data_files=Mydata_files, + options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} ) Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 15:03:28 UTC (rev 564) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 15:07:32 UTC (rev 565) @@ -35,9 +35,6 @@ ICO_SMARTCARD, ICO_READER])] setup(windows=['cardmonitor.py'], - data_files = Mydata_files, - options = - { - "py2exe": {"dll_excludes": ["MSVCP90.dll"]} - } + data_files=Mydata_files, + options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} ) Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 15:03:28 UTC (rev 564) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 15:07:32 UTC (rev 565) @@ -36,9 +36,6 @@ setup(windows=['readerviewer.py'], - data_files = Mydata_files, - options = - { - "py2exe": {"dll_excludes": ["MSVCP90.dll"]} - } + data_files=Mydata_files, + options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 15:03:34
|
Revision: 564 http://pyscard.svn.sourceforge.net/pyscard/?rev=564&view=rev Author: jdaussel Date: 2011-10-16 15:03:28 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E261 pep8 error at least two spaces before inline commen Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 15:02:15 UTC (rev 563) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 15:03:28 UTC (rev 564) @@ -35,7 +35,7 @@ ICO_SMARTCARD, ICO_READER])] -setup(windows = ['apdumanager.py'], +setup(windows= ['apdumanager.py'], data_files = Mydata_files, options = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 15:02:22
|
Revision: 563 http://pyscard.svn.sourceforge.net/pyscard/?rev=563&view=rev Author: jdaussel Date: 2011-10-16 15:02:15 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E261 pep8 error at least two spaces before inline commen Modified Paths: -------------- trunk/pyscard/src/smartcard/test/framework/testcase_CAtr.py Modified: trunk/pyscard/src/smartcard/test/framework/testcase_CAtr.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_CAtr.py 2011-10-16 15:00:33 UTC (rev 562) +++ trunk/pyscard/src/smartcard/test/framework/testcase_CAtr.py 2011-10-16 15:02:15 UTC (rev 563) @@ -111,8 +111,8 @@ self.assert_(a.getTB1() == 0x00) self.assert_(a.getTC1() == 0x00) self.assert_(a.getTD1() == 0x81) - self.assert_(a.TD[2 - 1] == 0x21) # TD2 - self.assert_(a.TB[3 - 1] == 0x45) # TB3 + self.assert_(a.TD[2 - 1] == 0x21) # TD2 + self.assert_(a.TB[3 - 1] == 0x45) # TB3 def suite(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 15:00:42
|
Revision: 562 http://pyscard.svn.sourceforge.net/pyscard/?rev=562&view=rev Author: jdaussel Date: 2011-10-16 15:00:33 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E501 pep8 line too long Modified Paths: -------------- trunk/pyscard/src/setup.py trunk/pyscard/src/smartcard/ATR.py trunk/pyscard/src/smartcard/AbstractCardRequest.py trunk/pyscard/src/smartcard/Card.py trunk/pyscard/src/smartcard/CardConnection.py trunk/pyscard/src/smartcard/CardConnectionObserver.py trunk/pyscard/src/smartcard/CardMonitoring.py trunk/pyscard/src/smartcard/Examples/framework/sample_CardConnectionDecorator.py trunk/pyscard/src/smartcard/Examples/framework/sample_ExclusiveCardConnection.py trunk/pyscard/src/smartcard/Examples/framework/sample_TransmitCardObserver.py trunk/pyscard/src/smartcard/Examples/framework/sample_apduTracerInterpreter.py trunk/pyscard/src/smartcard/Examples/framework/sample_toHexString.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py trunk/pyscard/src/smartcard/Exceptions.py trunk/pyscard/src/smartcard/ExclusiveConnectCardConnection.py trunk/pyscard/src/smartcard/ExclusiveTransmitCardConnection.py trunk/pyscard/src/smartcard/pcsc/PCSCCardConnection.py trunk/pyscard/src/smartcard/pcsc/PCSCCardRequest.py trunk/pyscard/src/smartcard/pcsc/PCSCPart10.py trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py trunk/pyscard/src/smartcard/pyro/server/PyroEventServer.py trunk/pyscard/src/smartcard/pyro/server/PyroNameServer.py trunk/pyscard/src/smartcard/pyro/server/RemoteReaderServer.py trunk/pyscard/src/smartcard/reader/ReaderGroups.py trunk/pyscard/src/smartcard/sw/ErrorCheckingChain.py trunk/pyscard/src/smartcard/sw/ISO7816_4ErrorChecker.py trunk/pyscard/src/smartcard/sw/ISO7816_8ErrorChecker.py trunk/pyscard/src/smartcard/sw/SWExceptions.py trunk/pyscard/src/smartcard/test/configcheck.py trunk/pyscard/src/smartcard/test/framework/testcase_ATR.py trunk/pyscard/src/smartcard/test/framework/testcase_Card.py trunk/pyscard/src/smartcard/test/framework/testcase_CardConnection.py trunk/pyscard/src/smartcard/test/framework/testcase_CardMonitor.py trunk/pyscard/src/smartcard/test/framework/testcase_CardRequest.py trunk/pyscard/src/smartcard/test/framework/testcase_CardService.py trunk/pyscard/src/smartcard/test/framework/testcase_CardType.py trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py trunk/pyscard/src/smartcard/test/framework/testcase_ExclusiveCardConnection.py trunk/pyscard/src/smartcard/test/framework/testcase_readergroups.py trunk/pyscard/src/smartcard/test/framework/testcase_readermonitor.py trunk/pyscard/src/smartcard/test/framework/testcase_readermonitorstress.py trunk/pyscard/src/smartcard/test/framework/testcase_readers.py trunk/pyscard/src/smartcard/test/framework/testcase_utils.py trunk/pyscard/src/smartcard/test/frameworkpcsc/testcase_pcscreadergroups.py trunk/pyscard/src/smartcard/test/manual/testcase_manualCardRequest.py trunk/pyscard/src/smartcard/test/scard/testcase_getatr.py trunk/pyscard/src/smartcard/test/scard/testcase_getattrib.py trunk/pyscard/src/smartcard/test/scard/testcase_geterrormessage.py trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py trunk/pyscard/src/smartcard/test/scard/testcase_locatecards.py trunk/pyscard/src/smartcard/test/scard/testcase_readergroups.py trunk/pyscard/src/smartcard/test/scard/testcase_transaction.py trunk/pyscard/src/smartcard/util/__init__.py trunk/pyscard/src/smartcard/wx/APDUTracerPanel.py trunk/pyscard/src/smartcard/wx/CardAndReaderTreePanel.py trunk/pyscard/src/smartcard/wx/ReaderToolbar.py trunk/pyscard/src/smartcard/wx/SimpleSCardAppEventObserver.py trunk/pyscard/src/smartcard/wx/SimpleSCardAppFrame.py trunk/pyscard/src/smartcard/wx/__init__.py trunk/pyscard/tools/commands/build-doc.py Modified: trunk/pyscard/src/setup.py =================================================================== --- trunk/pyscard/src/setup.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/setup.py 2011-10-16 15:00:33 UTC (rev 562) @@ -58,14 +58,20 @@ # python 2.3 # if python 2.5 is installed, get_platform() returns a string similar to # 'macosx-10.3-fat' -elif 'darwin' in get_platform() or 'macosx-10.3' in get_platform() or 'macosx-10.4' in get_platform(): - platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__TIGER__', '1')] - platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__'] - platform_sources = [] - platform_libraries = [] - platform_include_dirs = [] - platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0'] - platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb'] +elif 'darwin' in get_platform() \ + or 'macosx-10.3' in get_platform() \ + or 'macosx-10.4' in get_platform(): + platform__cc_defines = [('PCSCLITE', '1'), + ('__APPLE__', '1'), + ('__TIGER__', '1')] + platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__TIGER__'] + platform_sources = [] + platform_libraries = [] + platform_include_dirs = [] + platform_extra_compile_args = ['-v', '-framework', 'PCSC', + '-arch', 'i386', '-arch', + 'ppc', '-ggdb', '-O0'] + platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb'] # # Mac OS X Snow Leopard, python 2.6 @@ -75,12 +81,15 @@ # x86_64 and i386 # elif 'macosx-10.6' in get_platform() or 'macosx-10.7' in get_platform(): - platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')] + platform__cc_defines = [('PCSCLITE', '1'), + ('__APPLE__', '1'), + ('__LEOPARD__', '1')] platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__'] platform_sources = [] platform_libraries = [] platform_include_dirs = [] - platform_extra_compile_args = ['-v', '-arch', 'i386', '-arch', 'x86_64', '-ggdb'] + platform_extra_compile_args = ['-v', '-arch', 'i386', + '-arch', 'x86_64', '-ggdb'] platform_extra_link_args = ['-arch', 'i386', '-arch', 'x86_64', '-ggdb'] # @@ -88,12 +97,16 @@ # get_platform() returns a string similar to 'macosx-10.5-i386' # elif 'macosx-10.' in get_platform(): - platform__cc_defines = [('PCSCLITE', '1'), ('__APPLE__', '1'), ('__LEOPARD__', '1')] + platform__cc_defines = [('PCSCLITE', '1'), + ('__APPLE__', '1'), + ('__LEOPARD__', '1')] platform_swig_opts = ['-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__'] platform_sources = [] platform_libraries = [] platform_include_dirs = [] - platform_extra_compile_args = ['-v', '-framework', 'PCSC', '-arch', 'i386', '-arch', 'ppc', '-ggdb', '-O0'] + platform_extra_compile_args = ['-v', '-framework', 'PCSC', + '-arch', 'i386', + '-arch', 'ppc', '-ggdb', '-O0'] platform_extra_link_args = ['-arch', 'i386', '-arch', 'ppc', '-ggdb'] else: platform__cc_defines = [('PCSCLITE', '1')] @@ -106,7 +119,8 @@ class _pyscardBuildExt(build_ext): - '''Specialization of build_ext to enable swig_opts for python 2.3 distutils''' + '''Specialization of build_ext to enable swig_opts + for python 2.3 distutils''' if sys.version_info < (2, 4): # This copy of swig_sources is from Python 2.3. @@ -195,14 +209,18 @@ # the _scard.pyd extension to build 'ext_modules': [Extension("smartcard.scard._scard", define_macros=platform__cc_defines, - include_dirs=['smartcard/scard/'] + platform_include_dirs, + include_dirs=['smartcard/scard/'] \ + + platform_include_dirs, sources=["smartcard/scard/helpers.c", "smartcard/scard/winscarddll.c", - "smartcard/scard/scard.i"] + platform_sources, + "smartcard/scard/scard.i"] \ + + platform_sources, libraries=platform_libraries, extra_compile_args=platform_extra_compile_args, extra_link_args=platform_extra_link_args, - swig_opts=['-outdir', 'smartcard/scard'] + platform_swig_opts)], + swig_opts=['-outdir', + 'smartcard/scard'] \ + + platform_swig_opts)], 'cmdclass': {'build_ext': _pyscardBuildExt}, } Modified: trunk/pyscard/src/smartcard/ATR.py =================================================================== --- trunk/pyscard/src/smartcard/ATR.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/ATR.py 2011-10-16 15:00:33 UTC (rev 562) @@ -105,14 +105,25 @@ if self.hasTB[n]: self.TB[n] = self.bytes[offset + self.hasTA[n] + self.hasTB[n]] if self.hasTC[n]: - self.TC[n] = self.bytes[offset + self.hasTA[n] + self.hasTB[n] + self.hasTC[n]] + self.TC[n] = self.bytes[offset +\ + self.hasTA[n] +\ + self.hasTB[n] +\ + self.hasTC[n]] if self.hasTD[n]: - self.TD[n] = self.bytes[offset + self.hasTA[n] + self.hasTB[n] + self.hasTC[n] + self.hasTD[n]] + self.TD[n] = self.bytes[offset +\ + self.hasTA[n] +\ + self.hasTB[n] +\ + self.hasTC[n] +\ + self.hasTD[n]] - self.interfaceBytesCount += self.hasTA[n] + self.hasTB[n] + self.hasTC[n] + self.hasTD[n] + self.interfaceBytesCount += self.hasTA[n] +\ + self.hasTB[n] +\ + self.hasTC[n] +\ + self.hasTD[n] TD = self.TD[n] hasTD = self.hasTD[n] - offset = offset + self.hasTA[n] + self.hasTB[n] + self.hasTC[n] + self.hasTD[n] + offset = offset + self.hasTA[n] + self.hasTB[n] +\ + self.hasTC[n] + self.hasTD[n] n = n + 1 # historical bytes @@ -279,7 +290,8 @@ def __str__(self): """Returns a string representation of the ATR as a strem of bytes.""" - return reduce(lambda a, b: a + "%-0.2X " % ((b + 256) % 256), self.bytes, '') + return reduce(lambda a, b: a + \ + "%-0.2X " % ((b + 256) % 256), self.bytes, '') if __name__ == '__main__': @@ -299,4 +311,5 @@ print 80 * '-' print a a.dump() - print reduce(lambda a, b: a + "%-0.2X " % ((b + 256) % 256), a.getHistoricalBytes(), '') + print reduce(lambda a, b: a + \ + "%-0.2X " % ((b + 256) % 256), a.getHistoricalBytes(), '') Modified: trunk/pyscard/src/smartcard/AbstractCardRequest.py =================================================================== --- trunk/pyscard/src/smartcard/AbstractCardRequest.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/AbstractCardRequest.py 2011-10-16 15:00:33 UTC (rev 562) @@ -35,7 +35,8 @@ Known subclasses: smartcard.pcsc.PCSCCardRequest""" - 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 CardRequest. newcardonly: if True, request a new card; default is Modified: trunk/pyscard/src/smartcard/Card.py =================================================================== --- trunk/pyscard/src/smartcard/Card.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Card.py 2011-10-16 15:00:33 UTC (rev 562) @@ -46,7 +46,8 @@ """Return True if self==other (same reader and same atr). Return False otherwise.""" if isinstance(other, Card): - return (self.atr == other.atr and repr(self.reader) == repr(other.reader)) + return (self.atr == other.atr and + repr(self.reader) == repr(other.reader)) else: return False @@ -68,5 +69,6 @@ if readerobj: return readerobj.createConnection() else: - #raise CardConnectionException('not a valid reader: ' + str(self.reader)) + #raise CardConnectionException( + # 'not a valid reader: ' + str(self.reader)) return None Modified: trunk/pyscard/src/smartcard/CardConnection.py =================================================================== --- trunk/pyscard/src/smartcard/CardConnection.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/CardConnection.py 2011-10-16 15:00:33 UTC (rev 562) @@ -48,7 +48,8 @@ Observable.__init__(self) self.reader = reader self.errorcheckingchain = None - self.defaultprotocol = CardConnection.T0_protocol | CardConnection.T1_protocol + self.defaultprotocol = CardConnection.T0_protocol |\ + CardConnection.T1_protocol def __del__(self): """Connect to card.""" @@ -136,10 +137,16 @@ CardConnection.RAW_protocol """ Observable.setChanged(self) - Observable.notifyObservers(self, CardConnectionEvent('command', [bytes, protocol])) + Observable.notifyObservers(self, + CardConnectionEvent( + 'command', + [bytes, protocol])) data, sw1, sw2 = self.doTransmit(bytes, protocol) Observable.setChanged(self) - Observable.notifyObservers(self, CardConnectionEvent('response', [data, sw1, sw2])) + Observable.notifyObservers(self, + CardConnectionEvent( + 'response', + [data, sw1, sw2])) if None != self.errorcheckingchain: self.errorcheckingchain[0](data, sw1, sw2) return data, sw1, sw2 @@ -161,10 +168,16 @@ bytes: list of bytes to transmit """ Observable.setChanged(self) - Observable.notifyObservers(self, CardConnectionEvent('command', [controlCode, bytes])) + Observable.notifyObservers(self, + CardConnectionEvent( + 'command', + [controlCode, bytes])) data = self.doControl(controlCode, bytes) Observable.setChanged(self) - Observable.notifyObservers(self, CardConnectionEvent('response', data)) + Observable.notifyObservers(self, + CardConnectionEvent( + 'response', + data)) if None != self.errorcheckingchain: self.errorcheckingchain[0](data) return data @@ -181,7 +194,10 @@ attribId: attribute id like SCARD_ATTR_VENDOR_NAME """ Observable.setChanged(self) - Observable.notifyObservers(self, CardConnectionEvent('attrib', [attribId])) + Observable.notifyObservers(self, + CardConnectionEvent( + 'attrib', + [attribId])) data = self.doGetAttrib(attribId) if None != self.errorcheckingchain: self.errorcheckingchain[0](data) Modified: trunk/pyscard/src/smartcard/CardConnectionObserver.py =================================================================== --- trunk/pyscard/src/smartcard/CardConnectionObserver.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/CardConnectionObserver.py 2011-10-16 15:00:33 UTC (rev 562) @@ -62,4 +62,6 @@ if [] == ccevent.args[0]: print '< [] ', "%-2X %-2X" % tuple(ccevent.args[-2:]) else: - print '< ', toHexString(ccevent.args[0]), "%-2X %-2X" % tuple(ccevent.args[-2:]) + print '< ', \ + toHexString(ccevent.args[0]), \ + "%-2X %-2X" % tuple(ccevent.args[-2:]) Modified: trunk/pyscard/src/smartcard/CardMonitoring.py =================================================================== --- trunk/pyscard/src/smartcard/CardMonitoring.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/CardMonitoring.py 2011-10-16 15:00:33 UTC (rev 562) @@ -173,7 +173,8 @@ if addedcards != [] or removedcards != []: self.cards = currentcards self.observable.setChanged() - self.observable.notifyObservers((addedcards, removedcards)) + self.observable.notifyObservers( + (addedcards, removedcards)) # when CardMonitoringThread.__del__() is invoked in # response to shutdown, e.g., when execution of the @@ -204,7 +205,8 @@ def __init__(self, observable): if not CardMonitoringThread.instance: - CardMonitoringThread.instance = CardMonitoringThread.__CardMonitoringThreadSingleton(observable) + CardMonitoringThread.instance = \ + CardMonitoringThread.__CardMonitoringThreadSingleton(observable) CardMonitoringThread.instance.start() def __getattr__(self, name): Modified: trunk/pyscard/src/smartcard/Examples/framework/sample_CardConnectionDecorator.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_CardConnectionDecorator.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_CardConnectionDecorator.py 2011-10-16 15:00:33 UTC (rev 562) @@ -49,14 +49,16 @@ return bytes def uncypher(self, data): - '''Uncypher mock-up; you would include the secure channel logics here.''' + '''Uncypher mock-up; + you would include the secure channel logics here.''' print 'uncyphering', toHexString(data) return data def transmit(self, bytes, protocol=None): """Cypher/uncypher APDUs before transmission""" cypheredbytes = self.cypher(bytes) - data, sw1, sw2 = CardConnectionDecorator.transmit(self, cypheredbytes, protocol) + data, sw1, sw2 = CardConnectionDecorator.transmit( + self, cypheredbytes, protocol) if [] != data: data = self.uncypher(data) return data, sw1, sw2 @@ -91,7 +93,8 @@ cardservice.connection.addObserver(observer) # attach our decorator -cardservice.connection = FakeATRConnection(SecureChannelConnection(cardservice.connection)) +cardservice.connection = FakeATRConnection( + SecureChannelConnection(cardservice.connection)) # connect to the card and perform a few transmits cardservice.connection.connect() Modified: trunk/pyscard/src/smartcard/Examples/framework/sample_ExclusiveCardConnection.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_ExclusiveCardConnection.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_ExclusiveCardConnection.py 2011-10-16 15:00:33 UTC (rev 562) @@ -29,8 +29,10 @@ from smartcard.CardConnection import CardConnection from smartcard.util import toHexString -from smartcard.ExclusiveConnectCardConnection import ExclusiveConnectCardConnection -from smartcard.ExclusiveTransmitCardConnection import ExclusiveTransmitCardConnection +from smartcard.ExclusiveConnectCardConnection import \ + ExclusiveConnectCardConnection +from smartcard.ExclusiveTransmitCardConnection import \ + ExclusiveTransmitCardConnection # define the apdus used in this script @@ -48,7 +50,8 @@ cardservice.connection.addObserver(observer) # attach our decorator -cardservice.connection = ExclusiveTransmitCardConnection(ExclusiveConnectCardConnection(cardservice.connection)) +cardservice.connection = ExclusiveTransmitCardConnection( + ExclusiveConnectCardConnection(cardservice.connection)) # connect to the card and perform a few transmits cardservice.connection.connect() Modified: trunk/pyscard/src/smartcard/Examples/framework/sample_TransmitCardObserver.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_TransmitCardObserver.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_TransmitCardObserver.py 2011-10-16 15:00:33 UTC (rev 562) @@ -1,6 +1,7 @@ #! /usr/bin/env python """ -Sample script that monitors card insertions, connects to cards and transmit an apdu +Sample script that monitors card insertions, +connects to cards and transmit an apdu __author__ = "http://www.gemalto.com" @@ -47,7 +48,8 @@ print "+Inserted: ", toHexString(card.atr) card.connection = card.createConnection() card.connection.connect() - response, sw1, sw2 = card.connection.transmit(SELECT_DF_TELECOM) + response, sw1, sw2 = card.connection.transmit( + SELECT_DF_TELECOM) print "%.2x %.2x" % (sw1, sw2) for card in removedcards: Modified: trunk/pyscard/src/smartcard/Examples/framework/sample_apduTracerInterpreter.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_apduTracerInterpreter.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_apduTracerInterpreter.py 2011-10-16 15:00:33 UTC (rev 562) @@ -53,7 +53,9 @@ if [] == ccevent.args[0]: print '< []', "%-2X %-2X" % tuple(ccevent.args[-2:]) else: - print '<', toHexString(ccevent.args[0]), "%-2X %-2X" % tuple(ccevent.args[-2:]) + print '<', + toHexString(ccevent.args[0]), + "%-2X %-2X" % tuple(ccevent.args[-2:]) # define the apdus used in this script Modified: trunk/pyscard/src/smartcard/Examples/framework/sample_toHexString.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_toHexString.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_toHexString.py 2011-10-16 15:00:33 UTC (rev 562) @@ -35,8 +35,10 @@ print 'toHexString(bytes, PACK) =', toHexString(bytes, PACK) print 'toHexString(bytes, HEX) =', toHexString(bytes, HEX) print 'toHexString(bytes, HEX | COMMA) =', toHexString(bytes, HEX | COMMA) -print 'toHexString(bytes, HEX | UPPERCASE) =', toHexString(bytes, HEX | UPPERCASE) -print 'toHexString(bytes, HEX | UPPERCASE | COMMA) =', toHexString(bytes, HEX | UPPERCASE | COMMA) +print 'toHexString(bytes, HEX | UPPERCASE) =', \ + toHexString(bytes, HEX | UPPERCASE) +print 'toHexString(bytes, HEX | UPPERCASE | COMMA) =', \ + toHexString(bytes, HEX | UPPERCASE | COMMA) print 40 * '-' @@ -47,8 +49,10 @@ print 'toHexString(bytes, PACK) =', toHexString(bytes, PACK) print 'toHexString(bytes, HEX) =', toHexString(bytes, HEX) print 'toHexString(bytes, HEX | COMMA) =', toHexString(bytes, HEX | COMMA) -print 'toHexString(bytes, HEX | UPPERCASE) =', toHexString(bytes, HEX | UPPERCASE) -print 'toHexString(bytes, HEX | UPPERCASE | COMMA) =', toHexString(bytes, HEX | UPPERCASE | COMMA) +print 'toHexString(bytes, HEX | UPPERCASE) =', \ + toHexString(bytes, HEX | UPPERCASE) +print 'toHexString(bytes, HEX | UPPERCASE | COMMA) =', \ + toHexString(bytes, HEX | UPPERCASE | COMMA) import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2011-10-16 15:00:33 UTC (rev 562) @@ -31,13 +31,15 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: @@ -51,24 +53,36 @@ hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, zreader, SCARD_SHARE_DIRECT, SCARD_PROTOCOL_T0) if hresult != SCARD_S_SUCCESS: - raise error('Unable to connect: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to connect: ' + SCardGetErrorMessage(hresult)) print 'Connected with active protocol', dwActiveProtocol try: if 'winscard' == resourceManager: # IOCTL_SMARTCARD_GET_ATTRIBUTE = SCARD_CTL_CODE(2) - hresult, response = SCardControl(hcard, SCARD_CTL_CODE(2), toBytes("%.8lx" % SCARD_ATTR_VENDOR_NAME)) + hresult, response = SCardControl( + hcard, + SCARD_CTL_CODE(2), + toBytes("%.8lx" % SCARD_ATTR_VENDOR_NAME)) if hresult != SCARD_S_SUCCESS: - raise error('SCardControl failed: ' + SCardGetErrorMessage(hresult)) + raise error( + 'SCardControl failed: ' +\ + SCardGetErrorMessage(hresult)) r = "" for i in xrange(len(response)): r += "%c" % response[i] print 'SCARD_ATTR_VENDOR_NAME:', r - elif 'pcsclite' == resourceManager and not 'pcsclite-tiger' == resourceManagerSubType: + elif 'pcsclite' == resourceManager and \ + not 'pcsclite-tiger' == resourceManagerSubType: # get firmware on Gemplus readers - hresult, response = SCardControl(hcard, SCARD_CTL_CODE(1), [0x02]) + hresult, response = SCardControl( + hcard, + SCARD_CTL_CODE(1), + [0x02]) if hresult != SCARD_S_SUCCESS: - raise error('SCardControl failed: ' + SCardGetErrorMessage(hresult)) + raise error( + 'SCardControl failed: ' + \ + SCardGetErrorMessage(hresult)) r = "" for i in xrange(len(response)): r += "%c" % response[i] @@ -76,7 +90,9 @@ finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to disconnect: ' + \ + SCardGetErrorMessage(hresult)) print 'Disconnected' except error, (message): @@ -85,7 +101,9 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2011-10-16 15:00:33 UTC (rev 562) @@ -32,13 +32,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) if len(readers) < 1: raise Exception('No smart card readers') print 'PCSC Readers:', readers @@ -47,7 +51,9 @@ print 'Trying to retreive ATR of card in', reader hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, reader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) + hcontext, + reader, + SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult != SCARD_S_SUCCESS: print 'Unable to connect: ' + SCardGetErrorMessage(hresult) else: @@ -57,22 +63,27 @@ try: hresult, reader, state, protocol, atr = SCardStatus(hcard) if hresult != SCARD_S_SUCCESS: - print 'failed to get status: ' + SCardGetErrorMessage(hresult) + print 'failed to get status: ' + \ + SCardGetErrorMessage(hresult) print 'Reader:', reader print 'State:', hex(state) print 'Protocol:', protocol - print 'ATR:', smartcard.util.toHexString(atr, smartcard.util.HEX) + print 'ATR:', smartcard.util.toHexString( + atr, + smartcard.util.HEX) finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - print 'Failed to disconnect: ' + SCardGetErrorMessage(hresult) + print 'Failed to disconnect: ' + \ + SCardGetErrorMessage(hresult) print 'Disconnected' finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error('Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except Exception, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2011-10-16 15:00:33 UTC (rev 562) @@ -71,7 +71,8 @@ SCARD_ATTR_POWER_MGMT_SUPPORT: 'SCARD_ATTR_POWER_MGMT_SUPPORT', SCARD_ATTR_SUPRESS_T1_IFS_REQUEST: 'SCARD_ATTR_SUPRESS_T1_IFS_REQUEST', SCARD_ATTR_USER_AUTH_INPUT_DEVICE: 'SCARD_ATTR_USER_AUTH_INPUT_DEVICE', - SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE: 'SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE', + SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE: \ + 'SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE', SCARD_ATTR_VENDOR_IFD_SERIAL_NO: 'SCARD_ATTR_VENDOR_IFD_SERIAL_NO', SCARD_ATTR_VENDOR_IFD_TYPE: 'SCARD_ATTR_VENDOR_IFD_TYPE', SCARD_ATTR_VENDOR_IFD_VERSION: 'SCARD_ATTR_VENDOR_IFD_VERSION', @@ -93,13 +94,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: @@ -108,9 +113,12 @@ for reader in readers: hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, reader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) + hcontext, + reader, + SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult != SCARD_S_SUCCESS: - print error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) + print error, \ + 'Unable to connect: ' + SCardGetErrorMessage(hresult) else: print 'Connected with active protocol', dwActiveProtocol @@ -121,19 +129,25 @@ if hresult == SCARD_S_SUCCESS: printAttribute(i, attrib) else: - print '-----------------', attributes[i], '-----------------' + print '-----------------', \ + attributes[i], \ + '-----------------' print 'unsupported' finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to disconnect: ' + \ + SCardGetErrorMessage(hresult)) print 'Disconnected' finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except Exception, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py 2011-10-16 15:00:33 UTC (rev 562) @@ -29,8 +29,10 @@ from smartcard.scard import * import smartcard.util -srTreeATR = [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] -srTreeMask = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] +srTreeATR = \ + [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] +srTreeMask = \ + [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] def printstate(state): @@ -63,13 +65,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers readerstates = [] @@ -82,7 +88,10 @@ printstate(i) print '----- Please insert or remove a card ------------' - hresult, newstates = SCardGetStatusChange(hcontext, INFINITE, newstates) + hresult, newstates = SCardGetStatusChange( + hcontext, + INFINITE, + newstates) print '----- New reader and card states are: -----------' for i in newstates: @@ -91,7 +100,9 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py 2011-10-16 15:00:33 UTC (rev 562) @@ -30,22 +30,29 @@ if 'winscard' == resourceManager: # Cryptoflex 8k v2 is introduced in standard Windows 2000 - slbCryptoFlex8kv2ATR = [0x3B, 0x95, 0x15, 0x40, 0x00, 0x68, 0x01, 0x02, 0x00, 0x00] + slbCryptoFlex8kv2ATR = \ + [0x3B, 0x95, 0x15, 0x40, 0x00, 0x68, 0x01, 0x02, 0x00, 0x00] try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, card = SCardListCards(hcontext, slbCryptoFlex8kv2ATR, []) if hresult != SCARD_S_SUCCESS: - raise error('Failure to locate Schlumberger Cryptoflex 8k v2 card: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failure to locate Schlumberger Cryptoflex 8k v2 card: ' +\ + SCardGetErrorMessage(hresult)) print 'Located by ATR:', card hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: - raise error('Failure to list cards: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failure to list cards: ' + \ + SCardGetErrorMessage(hresult)) print 'Cards:', cards for i in cards: @@ -61,7 +68,9 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 15:00:33 UTC (rev 562) @@ -32,49 +32,73 @@ if 'winscard' == resourceManager: znewcardName = 'dummy-card' - znewcardATR = [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] - znewcardMask = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] - znewcardPrimGuid = smartcard.guid.strToGUID('{128F3806-4F70-4ccf-977A-60C390664840}') - znewcardSecGuid = smartcard.guid.strToGUID('{EB7F69EA-BA20-47d0-8C50-11CFDEB63BBE}') + znewcardATR = \ + [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] + znewcardMask = \ + [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] + znewcardPrimGuid = \ + smartcard.guid.strToGUID('{128F3806-4F70-4ccf-977A-60C390664840}') + znewcardSecGuid = \ + smartcard.guid.strToGUID('{EB7F69EA-BA20-47d0-8C50-11CFDEB63BBE}') try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise scard.error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise scard.error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: # list interfaces for a known card - hresult, interfaces = SCardListInterfaces(hcontext, 'Schlumberger Cryptoflex 8k v2') + hresult, interfaces = SCardListInterfaces( + hcontext, + 'Schlumberger Cryptoflex 8k v2') if hresult != SCARD_S_SUCCESS: - raise scard.error, 'Failed to list interfaces: ' + SCardGetErrorMessage(hresult) + raise scard.error( + 'Failed to list interfaces: ' + \ + SCardGetErrorMessage(hresult)) print 'Interfaces for Schlumberger Cryptoflex 8k v2:', interfaces # introduce a card (forget first in case it is already present) hresult = SCardForgetCardType(hcontext, znewcardName) print 'Introducing card ' + znewcardName - hresult = SCardIntroduceCardType(hcontext, znewcardName, znewcardPrimGuid, - znewcardPrimGuid + znewcardSecGuid, znewcardATR, znewcardMask) + hresult = SCardIntroduceCardType( + hcontext, + znewcardName, + znewcardPrimGuid, + znewcardPrimGuid + znewcardSecGuid, + znewcardATR, + znewcardMask) if hresult != SCARD_S_SUCCESS: - raise error('Failed to introduce card type: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to introduce card type: ' + \ + SCardGetErrorMessage(hresult)) # list card interfaces hresult, interfaces = SCardListInterfaces(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list interfaces: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list interfaces: ' + \ + SCardGetErrorMessage(hresult)) for i in interfaces: - print 'Interface for ' + znewcardName + ' :', smartcard.guid.GUIDToStr(i) + print 'Interface for ' + znewcardName + ' :', \ + smartcard.guid.GUIDToStr(i) print 'Forgeting card ' + znewcardName hresult = SCardForgetCardType(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: - raise error('Failed to remove card type: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to remove card type: ' + \ + SCardGetErrorMessage(hresult)) finally: hresult2 = SCardReleaseContext(hcontext) if hresult2 != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except error: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 15:00:33 UTC (rev 562) @@ -31,19 +31,25 @@ if 'winscard' == resourceManager: znewcardName = 'dummy-card' - znewcardATR = [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] - znewcardMask = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] + znewcardATR = \ + [0x3B, 0x77, 0x94, 0x00, 0x00, 0x82, 0x30, 0x00, 0x13, 0x6C, 0x9F, 0x22] + znewcardMask = \ + [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise scard.error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise scard.error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise scard.error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise scard.error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers # introduce a card (forget first in case it is already present) @@ -55,7 +61,9 @@ if hresult == ERROR_ALREADY_EXISTS: print 'Card already exists' else: - raise error('Failed to introduce card type: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to introduce card type: ' + \ + SCardGetErrorMessage(hresult)) hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: @@ -67,7 +75,10 @@ readerstates += [(readers[i], SCARD_STATE_UNAWARE)] print readerstates - hresult, newstates = SCardLocateCards(hcontext, cards, readerstates) + hresult, newstates = SCardLocateCards( + hcontext, + cards, + readerstates) for i in newstates: reader, eventstate, atr = i print reader, @@ -87,9 +98,9 @@ if eventstate & SCARD_STATE_PRESENT: print 'Card present in reader' if eventstate & SCARD_STATE_EXCLUSIVE: - print 'Card allocated for exclusive use by another application' + print 'Card allocated for exclusive use' if eventstate & SCARD_STATE_INUSE: - print 'Card in used by another application but can be shared' + print 'Card in use but can be shared' if eventstate & SCARD_STATE_MUTE: print 'Card is mute' if eventstate & SCARD_STATE_CHANGED: @@ -101,7 +112,9 @@ hresult = SCardForgetCardType(hcontext, znewcardName) hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2011-10-16 15:00:33 UTC (rev 562) @@ -50,7 +50,10 @@ while len(response) > 0: tag = response[0] if feature == tag: - return (((((response[2] << 8) + response[3]) << 8) + response[4]) << 8) + response[5] + return (((((response[2] << 8) + \ + response[3]) << 8) + \ + response[4]) << 8) + \ + response[5] response = response[6:] @@ -109,7 +112,10 @@ try: SELECT = [0x00, 0xA4, 0x04, 0x00, 0x06, 0xA0, 0x00, 0x00, 0x00, 0x18, 0xFF] - hresult, response = SCardTransmit(hcard, dwActiveProtocol, SELECT) + hresult, response = SCardTransmit( + hcard, + dwActiveProtocol, + SELECT) if hresult != SCARD_S_SUCCESS: raise BaseSCardException(hresult) Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 15:00:33 UTC (rev 562) @@ -33,82 +33,120 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to list reader groups: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups if 'winscard' == resourceManager: hresult = SCardIntroduceReaderGroup(hcontext, newgroup) if hresult != SCARD_S_SUCCESS: - raise error('Unable to introduce reader group: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to introduce reader group: ' + \ + SCardGetErrorMessage(hresult)) dummyreader = readers[0] + ' dummy' hresult = SCardIntroduceReader(hcontext, dummyreader, readers[0]) if hresult != SCARD_S_SUCCESS: - raise error('Unable to introduce reader: ' + dummyreader + ' : ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to introduce reader: ' + \ + dummyreader + ' : ' + \ + SCardGetErrorMessage(hresult)) hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers hresult = SCardAddReaderToGroup(hcontext, dummyreader, newgroup) if hresult != SCARD_S_SUCCESS: - raise error('Unable to add reader to group: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to add reader to group: ' + \ + SCardGetErrorMessage(hresult)) hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to list reader groups: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups hresult, readers = SCardListReaders(hcontext, [newgroup]) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers in group ' + newgroup + ' : ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers in group ' + \ + newgroup + ' : ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers in reader group', newgroup, ':', readers - hresult = SCardRemoveReaderFromGroup(hcontext, dummyreader, newgroup) + hresult = SCardRemoveReaderFromGroup( + hcontext, + dummyreader, + newgroup) if hresult != SCARD_S_SUCCESS: - raise error('Unable to remove reader from group: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to remove reader from group: ' + \ + SCardGetErrorMessage(hresult)) hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to list reader groups: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups hresult = SCardForgetReaderGroup(hcontext, newgroup) if hresult != SCARD_S_SUCCESS: - raise error('Unable to forget reader group: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to forget reader group: ' + \ + SCardGetErrorMessage(hresult)) hresult = SCardForgetReader(hcontext, dummyreader) if hresult != SCARD_S_SUCCESS: - raise error('Failed to forget readers ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to forget readers ' + \ + SCardGetErrorMessage(hresult)) hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers elif 'pcsclite' == resourceManager: hresult, readers = SCardListReaders(hcontext, readerGroups) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers in groups ' + repr(readerGroups) + ' : ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers in groups ' + \ + repr(readerGroups) + ' : ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers in reader group', readerGroups, ':', readers finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py 2011-10-16 13:19:22 UTC (rev 561) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py 2011-10-16 15:00:33 UTC (rev 562) @@ -31,24 +31,32 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to establish context: ' + \ + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to list readers: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Unable to list reader groups: ' + \ + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) + raise error( + 'Failed to release context: ' + \ + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pys... [truncated message content] |
From: <jda...@us...> - 2011-10-16 13:19:29
|
Revision: 561 http://pyscard.svn.sourceforge.net/pyscard/?rev=561&view=rev Author: jdaussel Date: 2011-10-16 13:19:22 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Added sample_pinpad.py to project Modified Paths: -------------- trunk/pyscard/tools/vslick/pyscard.vpj Modified: trunk/pyscard/tools/vslick/pyscard.vpj =================================================================== --- trunk/pyscard/tools/vslick/pyscard.vpj 2011-10-16 12:33:58 UTC (rev 560) +++ trunk/pyscard/tools/vslick/pyscard.vpj 2011-10-16 13:19:22 UTC (rev 561) @@ -316,6 +316,7 @@ <F N="../../src/smartcard/Examples/scard-api/sample_listCards.py"/> <F N="../../src/smartcard/Examples/scard-api/sample_listInterfaces.py"/> <F N="../../src/smartcard/Examples/scard-api/sample_locateCards.py"/> + <F N="../../src/smartcard/Examples/scard-api/sample_pinpad.py"/> <F N="../../src/smartcard/Examples/scard-api/sample_readerGroups.py"/> <F N="../../src/smartcard/Examples/scard-api/sample_readers.py"/> <F N="../../src/smartcard/Examples/scard-api/sample_selectDFTelecom.py"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 12:34:05
|
Revision: 560 http://pyscard.svn.sourceforge.net/pyscard/?rev=560&view=rev Author: jdaussel Date: 2011-10-16 12:33:58 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed W602 pep8 warning (deprecated form of raising exception) Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py trunk/pyscard/src/smartcard/util/__init__.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2011-10-16 12:33:58 UTC (rev 560) @@ -31,17 +31,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: - raise error, 'No smart card readers' + raise error('No smart card readers') for zreader in readers: @@ -51,7 +51,7 @@ hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, zreader, SCARD_SHARE_DIRECT, SCARD_PROTOCOL_T0) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) + raise error('Unable to connect: ' + SCardGetErrorMessage(hresult)) print 'Connected with active protocol', dwActiveProtocol try: @@ -59,7 +59,7 @@ # IOCTL_SMARTCARD_GET_ATTRIBUTE = SCARD_CTL_CODE(2) hresult, response = SCardControl(hcard, SCARD_CTL_CODE(2), toBytes("%.8lx" % SCARD_ATTR_VENDOR_NAME)) if hresult != SCARD_S_SUCCESS: - raise error, 'SCardControl failed: ' + SCardGetErrorMessage(hresult) + raise error('SCardControl failed: ' + SCardGetErrorMessage(hresult)) r = "" for i in xrange(len(response)): r += "%c" % response[i] @@ -68,7 +68,7 @@ # get firmware on Gemplus readers hresult, response = SCardControl(hcard, SCARD_CTL_CODE(1), [0x02]) if hresult != SCARD_S_SUCCESS: - raise error, 'SCardControl failed: ' + SCardGetErrorMessage(hresult) + raise error('SCardControl failed: ' + SCardGetErrorMessage(hresult)) r = "" for i in xrange(len(response)): r += "%c" % response[i] @@ -76,7 +76,7 @@ finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to disconnect: ' + SCardGetErrorMessage(hresult) + raise error('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) print 'Disconnected' except error, (message): @@ -85,7 +85,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2011-10-16 12:33:58 UTC (rev 560) @@ -32,13 +32,13 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) if len(readers) < 1: raise Exception('No smart card readers') print 'PCSC Readers:', readers @@ -72,7 +72,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except Exception, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2011-10-16 12:33:58 UTC (rev 560) @@ -93,17 +93,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Faile to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: - raise error, 'No smart card readers' + raise error('No smart card readers') print 'Trying to retreive attributes of', readers[0] for reader in readers: @@ -127,13 +127,13 @@ finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to disconnect: ' + SCardGetErrorMessage(hresult) + raise error('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) print 'Disconnected' finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except Exception, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getStatusChange.py 2011-10-16 12:33:58 UTC (rev 560) @@ -63,13 +63,13 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers readerstates = [] @@ -91,7 +91,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_listCards.py 2011-10-16 12:33:58 UTC (rev 560) @@ -34,18 +34,18 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, card = SCardListCards(hcontext, slbCryptoFlex8kv2ATR, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failure to locate Schlumberger Cryptoflex 8k v2 card: ' + SCardGetErrorMessage(hresult) + raise error('Failure to locate Schlumberger Cryptoflex 8k v2 card: ' + SCardGetErrorMessage(hresult)) print 'Located by ATR:', card hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failure to list cards: ' + SCardGetErrorMessage(hresult) + raise error('Failure to list cards: ' + SCardGetErrorMessage(hresult)) print 'Cards:', cards for i in cards: @@ -61,7 +61,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 12:33:58 UTC (rev 560) @@ -57,24 +57,24 @@ hresult = SCardIntroduceCardType(hcontext, znewcardName, znewcardPrimGuid, znewcardPrimGuid + znewcardSecGuid, znewcardATR, znewcardMask) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to introduce card type: ' + SCardGetErrorMessage(hresult) + raise error('Failed to introduce card type: ' + SCardGetErrorMessage(hresult)) # list card interfaces hresult, interfaces = SCardListInterfaces(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list interfaces: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list interfaces: ' + SCardGetErrorMessage(hresult)) for i in interfaces: print 'Interface for ' + znewcardName + ' :', smartcard.guid.GUIDToStr(i) print 'Forgeting card ' + znewcardName hresult = SCardForgetCardType(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to remove card type: ' + SCardGetErrorMessage(hresult) + raise error('Failed to remove card type: ' + SCardGetErrorMessage(hresult)) finally: hresult2 = SCardReleaseContext(hcontext) if hresult2 != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 12:33:58 UTC (rev 560) @@ -55,11 +55,11 @@ if hresult == ERROR_ALREADY_EXISTS: print 'Card already exists' else: - raise error, 'Failed to introduce card type: ' + SCardGetErrorMessage(hresult) + raise error('Failed to introduce card type: ' + SCardGetErrorMessage(hresult)) hresult, cards = SCardListCards(hcontext, [], []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failure to list cards' + raise error('Failure to list cards') print 'Cards:', cards readerstates = [] @@ -101,7 +101,7 @@ hresult = SCardForgetCardType(hcontext, znewcardName) hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 12:33:58 UTC (rev 560) @@ -33,82 +33,82 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to list reader groups: ' + SCardGetErrorMessage(hresult) + raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups if 'winscard' == resourceManager: hresult = SCardIntroduceReaderGroup(hcontext, newgroup) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to introduce reader group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to introduce reader group: ' + SCardGetErrorMessage(hresult)) dummyreader = readers[0] + ' dummy' hresult = SCardIntroduceReader(hcontext, dummyreader, readers[0]) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to introduce reader: ' + dummyreader + ' : ' + SCardGetErrorMessage(hresult) + raise error('Unable to introduce reader: ' + dummyreader + ' : ' + SCardGetErrorMessage(hresult)) hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers hresult = SCardAddReaderToGroup(hcontext, dummyreader, newgroup) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to add reader to group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to add reader to group: ' + SCardGetErrorMessage(hresult)) hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to list reader groups: ' + SCardGetErrorMessage(hresult) + raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups hresult, readers = SCardListReaders(hcontext, [newgroup]) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers in group ' + newgroup + ' : ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers in group ' + newgroup + ' : ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers in reader group', newgroup, ':', readers hresult = SCardRemoveReaderFromGroup(hcontext, dummyreader, newgroup) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to remove reader from group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to remove reader from group: ' + SCardGetErrorMessage(hresult)) hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to list reader groups: ' + SCardGetErrorMessage(hresult) + raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups hresult = SCardForgetReaderGroup(hcontext, newgroup) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to forget reader group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to forget reader group: ' + SCardGetErrorMessage(hresult)) hresult = SCardForgetReader(hcontext, dummyreader) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to forget readers ' + SCardGetErrorMessage(hresult) + raise error('Failed to forget readers ' + SCardGetErrorMessage(hresult)) hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers in all groups:', readers elif 'pcsclite' == resourceManager: hresult, readers = SCardListReaders(hcontext, readerGroups) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers in groups ' + repr(readerGroups) + ' : ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers in groups ' + repr(readerGroups) + ' : ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers in reader group', readerGroups, ':', readers finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readers.py 2011-10-16 12:33:58 UTC (rev 560) @@ -31,24 +31,24 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers hresult, readerGroups = SCardListReaderGroups(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to list reader groups: ' + SCardGetErrorMessage(hresult) + raise error('Unable to list reader groups: ' + SCardGetErrorMessage(hresult)) print 'PCSC Reader groups:', readerGroups finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' import sys Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py 2011-10-16 12:33:58 UTC (rev 560) @@ -36,17 +36,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context : ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context : ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: - raise error, 'No smart card readers' + raise error('No smart card readers') for zreader in readers: @@ -56,22 +56,22 @@ hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult != SCARD_S_SUCCESS: - raise error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) + raise error('Unable to connect: ' + SCardGetErrorMessage(hresult)) print 'Connected with active protocol', dwActiveProtocol try: hresult, response = SCardTransmit(hcard, dwActiveProtocol, SELECT + DF_TELECOM) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) + raise error('Failed to transmit: ' + SCardGetErrorMessage(hresult)) print 'Selected DF_TELECOM: ' + smartcard.util.toHexString(response, smartcard.util.HEX) hresult, response = SCardTransmit(hcard, dwActiveProtocol, GET_RESPONSE + [response[1]]) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) + raise error('Failed to transmit: ' + SCardGetErrorMessage(hresult)) print 'GET_RESPONSE after SELECT DF_TELECOM: ' + smartcard.util.toHexString(response, smartcard.util.HEX) finally: hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to disconnect: ' + SCardGetErrorMessage(hresult) + raise error('Failed to disconnect: ' + SCardGetErrorMessage(hresult)) print 'Disconnected' except error, (message): @@ -80,7 +80,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py 2011-10-16 12:33:58 UTC (rev 560) @@ -31,17 +31,17 @@ try: hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) print 'Context established!' try: hresult, readers = SCardListReaders(hcontext, []) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers:: ' + SCardGetErrorMessage(hresult) + raise error('Failed to list readers:: ' + SCardGetErrorMessage(hresult)) print 'PCSC Readers:', readers if len(readers) < 1: - raise error, 'No smart card readers' + raise error('No smart card readers') for zreader in readers: print 'Trying to perform transaction on card in', zreader @@ -50,18 +50,18 @@ hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult != SCARD_S_SUCCESS: - raise error, 'unable to connect: ' + SCardGetErrorMessage(hresult) + raise error('unable to connect: ' + SCardGetErrorMessage(hresult)) print 'Connected with active protocol', dwActiveProtocol try: hresult = SCardBeginTransaction(hcard) if hresult != SCARD_S_SUCCESS: - raise error, 'failed to begin transaction: ' + SCardGetErrorMessage(hresult) + raise error('failed to begin transaction: ' + SCardGetErrorMessage(hresult)) print 'Beginning transaction' hresult, reader, state, protocol, atr = SCardStatus(hcard) if hresult != SCARD_S_SUCCESS: - raise error, 'failed to get status: ' + SCardGetErrorMessage(hresult) + raise error('failed to get status: ' + SCardGetErrorMessage(hresult)) print 'ATR:', for i in xrange(len(atr)): print "0x%.2X" % atr[i], @@ -70,12 +70,12 @@ finally: hresult = SCardEndTransaction(hcard, SCARD_LEAVE_CARD) if hresult != SCARD_S_SUCCESS: - raise error, 'failed to end transaction: ' + SCardGetErrorMessage(hresult) + raise error('failed to end transaction: ' + SCardGetErrorMessage(hresult)) print 'Transaction ended' hresult = SCardDisconnect(hcard, SCARD_UNPOWER_CARD) if hresult != SCARD_S_SUCCESS: - raise error, 'failed to disconnect: ' + SCardGetErrorMessage(hresult) + raise error('failed to disconnect: ' + SCardGetErrorMessage(hresult)) print 'Disconnected' except error, (message): print error, message @@ -83,7 +83,7 @@ finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: - raise error, 'failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('failed to release context: ' + SCardGetErrorMessage(hresult)) print 'Released context.' except error, e: Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReaderGroups.py 2011-10-16 12:33:58 UTC (rev 560) @@ -65,15 +65,15 @@ hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if 0 != hresult: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) try: hresult = SCardIntroduceReaderGroup(hcontext, newgroup) if 0 != hresult: - raise error, 'Unable to introduce reader group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to introduce reader group: ' + SCardGetErrorMessage(hresult)) finally: hresult = SCardReleaseContext(hcontext) if 0 != hresult: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) def removereadergroup(self, group): """Remove a reader group""" @@ -82,15 +82,15 @@ hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER) if 0 != hresult: - raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to establish context: ' + SCardGetErrorMessage(hresult)) try: hresult = SCardForgetReaderGroup(hcontext, group) if hresult != 0: - raise error, 'Unable to forget reader group: ' + SCardGetErrorMessage(hresult) + raise error('Unable to forget reader group: ' + SCardGetErrorMessage(hresult)) finally: hresult = SCardReleaseContext(hcontext) if 0 != hresult: - raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error('Failed to release context: ' + SCardGetErrorMessage(hresult)) class PCSCReaderGroups(readergroups): Modified: trunk/pyscard/src/smartcard/util/__init__.py =================================================================== --- trunk/pyscard/src/smartcard/util/__init__.py 2011-10-16 12:11:57 UTC (rev 559) +++ trunk/pyscard/src/smartcard/util/__init__.py 2011-10-16 12:33:58 UTC (rev 560) @@ -94,7 +94,7 @@ try: return reduce(lambda x, y: x + [int(y, 16)], unpack('2s' * (len(packedstring) / 2), packedstring), []) except: - raise TypeError, 'not a string representing a list of bytes' + raise TypeError('not a string representing a list of bytes') """GSM3.38 character conversion table.""" @@ -195,7 +195,7 @@ pass if type(bytes) is not list: - raise TypeError, 'not a list of bytes' + raise TypeError('not a list of bytes') if bytes == None or bytes == []: return "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 12:12:03
|
Revision: 559 http://pyscard.svn.sourceforge.net/pyscard/?rev=559&view=rev Author: jdaussel Date: 2011-10-16 12:11:57 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed pep8 E225 missing whitespace around operator Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 11:04:27 UTC (rev 558) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 12:11:57 UTC (rev 559) @@ -33,7 +33,7 @@ Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER])] -setup(windows=['apdumanager.py'], +setup(windows = ['apdumanager.py'], data_files = Mydata_files, options = { Modified: trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 11:04:27 UTC (rev 558) +++ trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 12:11:57 UTC (rev 559) @@ -79,7 +79,7 @@ # locate a known card # Cryptoflex 8k v2 is present in standard Windows 2000 def test_listcryptoflexbyatr(self): - if 'Windows-7-6.1.7600'==platform.platform(): + if 'Windows-7-6.1.7600' == platform.platform(): dmyATR = [0x3B, 0x75, 0x94, 0x00, 0x00, 0x62, 0x02, 0x02, 0x01, 0x01] dmyName = ['dummycard'] hresult, card = SCardListCards(self.hcontext, dmyATR, []) @@ -112,7 +112,7 @@ # locate all cards and interfaces in the system def test_listallcards(self): - if 'Windows-7-6.1.7600'==platform.platform(): + if 'Windows-7-6.1.7600' == platform.platform(): expectedCards = ['Identity Device (Microsoft Generic Profile)', 'Identity Device (NIST SP 800-73 [PIV])'] else: @@ -131,7 +131,7 @@ self.assert_(i in foundCards) # dummycard has a primary provider, other cards have no primary provider - if 'Windows-7-6.1.7600'==platform.platform(): + if 'Windows-7-6.1.7600' == platform.platform(): expectedPrimaryProviderResult = { 'dummycard': [0, self.dummycardguid1], 'Identity Device (Microsoft Generic Profile)': [2, None], @@ -152,7 +152,7 @@ self.assertEquals(providername, smartcard.guid.GUIDToStr(expectedPrimaryProviderResult[cards[i]][1])) # dummycard has no CSP, other cards have a CSP - if 'Windows-7-6.1.7600'==platform.platform(): + if 'Windows-7-6.1.7600' == platform.platform(): expectedProviderCSPResult = { 'dummycard': [2, None], 'Identity Device (Microsoft Generic Profile)': [0, 'Microsoft Base Smart Card Crypto Provider'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 11:04:33
|
Revision: 558 http://pyscard.svn.sourceforge.net/pyscard/?rev=558&view=rev Author: jdaussel Date: 2011-10-16 11:04:27 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed E231 pep8 error: missing whitespace after : Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 11:01:54 UTC (rev 557) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 11:04:27 UTC (rev 558) @@ -37,6 +37,6 @@ data_files = Mydata_files, options = { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} + "py2exe": {"dll_excludes": ["MSVCP90.dll"]} } ) Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 11:01:54 UTC (rev 557) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 11:04:27 UTC (rev 558) @@ -36,6 +36,6 @@ data_files = Mydata_files, options = { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} + "py2exe": {"dll_excludes": ["MSVCP90.dll"]} } ) Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 11:01:54 UTC (rev 557) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 11:04:27 UTC (rev 558) @@ -37,6 +37,6 @@ data_files = Mydata_files, options = { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} + "py2exe": {"dll_excludes": ["MSVCP90.dll"]} } ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 11:02:00
|
Revision: 557 http://pyscard.svn.sourceforge.net/pyscard/?rev=557&view=rev Author: jdaussel Date: 2011-10-16 11:01:54 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed pep8 E202 and E201 whitespace after/before []{} Modified Paths: -------------- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py Modified: trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 11:00:23 UTC (rev 556) +++ trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 11:01:54 UTC (rev 557) @@ -135,7 +135,7 @@ expectedPrimaryProviderResult = { 'dummycard': [0, self.dummycardguid1], 'Identity Device (Microsoft Generic Profile)': [2, None], - 'Identity Device (NIST SP 800-73 [PIV])': [2, None] } + 'Identity Device (NIST SP 800-73 [PIV])': [2, None]} else: expectedPrimaryProviderResult = { 'dummycard': [0, self.dummycardguid1], @@ -156,7 +156,7 @@ expectedProviderCSPResult = { 'dummycard': [2, None], 'Identity Device (Microsoft Generic Profile)': [0, 'Microsoft Base Smart Card Crypto Provider'], - 'Identity Device (NIST SP 800-73 [PIV])': [0, 'Microsoft Base Smart Card Crypto Provider'] } + 'Identity Device (NIST SP 800-73 [PIV])': [0, 'Microsoft Base Smart Card Crypto Provider']} else: expectedProviderCSPResult = { 'dummycard': [2, None], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 11:00:29
|
Revision: 556 http://pyscard.svn.sourceforge.net/pyscard/?rev=556&view=rev Author: jdaussel Date: 2011-10-16 11:00:23 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed pep8 E202 and E201 whitespace after/before [] Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 10:57:30 UTC (rev 555) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 11:00:23 UTC (rev 556) @@ -30,7 +30,7 @@ from smartcard.wx import ICO_SMARTCARD, ICO_READER -Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER ])] +Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER])] setup(windows=['apdumanager.py'], Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 10:57:30 UTC (rev 555) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 11:00:23 UTC (rev 556) @@ -30,7 +30,7 @@ from smartcard.wx import ICO_SMARTCARD, ICO_READER -Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER ])] +Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER])] setup(windows=['cardmonitor.py'], data_files = Mydata_files, Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 10:57:30 UTC (rev 555) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 11:00:23 UTC (rev 556) @@ -30,7 +30,7 @@ from smartcard.wx import ICO_SMARTCARD, ICO_READER -Mydata_files = [('images', ['images/readerviewer.ico', ICO_SMARTCARD, ICO_READER ])] +Mydata_files = [('images', ['images/readerviewer.ico', ICO_SMARTCARD, ICO_READER])] setup(windows=['readerviewer.py'], Modified: trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 10:57:30 UTC (rev 555) +++ trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 11:00:23 UTC (rev 556) @@ -113,8 +113,8 @@ def test_listallcards(self): if 'Windows-7-6.1.7600'==platform.platform(): - expectedCards = [ 'Identity Device (Microsoft Generic Profile)', - 'Identity Device (NIST SP 800-73 [PIV])' ] + expectedCards = ['Identity Device (Microsoft Generic Profile)', + 'Identity Device (NIST SP 800-73 [PIV])'] else: # dummycard has been introduced in the test setup and # will be removed in the test teardown. Other cards are This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 10:57:36
|
Revision: 555 http://pyscard.svn.sourceforge.net/pyscard/?rev=555&view=rev Author: jdaussel Date: 2011-10-16 10:57:30 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed pep8 E201 error: whitespace after ( Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py 2011-10-16 10:57:30 UTC (rev 555) @@ -45,9 +45,9 @@ even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" if we_are_frozen(): - return os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( ))) + return os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding())) - return os.path.dirname(unicode(__file__, sys.getfilesystemencoding( ))) + return os.path.dirname(unicode(__file__, sys.getfilesystemencoding())) def main(argv): @@ -55,7 +55,7 @@ appname='A tool to send apdu to a card', apppanel=SampleAPDUManagerPanel, appstyle=TR_SMARTCARD | TR_READER | PANEL_APDUTRACER, - appicon=os.path.join( module_path(), 'images', 'mysmartcard.ico'), + appicon=os.path.join(module_path(), 'images', 'mysmartcard.ico'), size=(800, 600)) app.MainLoop() Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 10:57:30 UTC (rev 555) @@ -33,10 +33,10 @@ Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER ])] -setup( windows=['apdumanager.py'], - data_files = Mydata_files, - options = - { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} - } - ) +setup(windows=['apdumanager.py'], + data_files = Mydata_files, + options = + { + "py2exe":{"dll_excludes":["MSVCP90.dll"]} + } +) Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:57:30 UTC (rev 555) @@ -45,9 +45,9 @@ even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" if we_are_frozen(): - return os.path.dirname( unicode(sys.executable, sys.getfilesystemencoding( )) ) + return os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding())) - return os.path.dirname(unicode(__file__, sys.getfilesystemencoding( ))) + return os.path.dirname(unicode(__file__, sys.getfilesystemencoding())) class SamplePanel(wx.Panel, SimpleSCardAppEventObserver): Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 10:57:30 UTC (rev 555) @@ -32,10 +32,10 @@ Mydata_files = [('images', ['images/mysmartcard.ico', ICO_SMARTCARD, ICO_READER ])] -setup( windows=['cardmonitor.py'], - data_files = Mydata_files, - options = - { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} - } - ) +setup(windows=['cardmonitor.py'], + data_files = Mydata_files, + options = + { + "py2exe":{"dll_excludes":["MSVCP90.dll"]} + } +) Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py 2011-10-16 10:57:30 UTC (rev 555) @@ -41,9 +41,9 @@ even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" if we_are_frozen(): - return os.path.dirname( unicode(sys.executable, sys.getfilesystemencoding( )) ) + return os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding())) - return os.path.dirname(unicode(__file__, sys.getfilesystemencoding( ))) + return os.path.dirname(unicode(__file__, sys.getfilesystemencoding())) def main(argv): Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 10:57:30 UTC (rev 555) @@ -33,10 +33,10 @@ Mydata_files = [('images', ['images/readerviewer.ico', ICO_SMARTCARD, ICO_READER ])] -setup( windows=['readerviewer.py'], - data_files = Mydata_files, - options = - { - "py2exe":{"dll_excludes":["MSVCP90.dll"]} - } - ) +setup(windows=['readerviewer.py'], + data_files = Mydata_files, + options = + { + "py2exe":{"dll_excludes":["MSVCP90.dll"]} + } +) Modified: trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 10:51:41 UTC (rev 554) +++ trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 10:57:30 UTC (rev 555) @@ -113,7 +113,7 @@ def test_listallcards(self): if 'Windows-7-6.1.7600'==platform.platform(): - expectedCards = [ 'Identity Device (Microsoft Generic Profile)', + expectedCards = [ 'Identity Device (Microsoft Generic Profile)', 'Identity Device (NIST SP 800-73 [PIV])' ] else: # dummycard has been introduced in the test setup and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 10:51:48
|
Revision: 554 http://pyscard.svn.sourceforge.net/pyscard/?rev=554&view=rev Author: jdaussel Date: 2011-10-16 10:51:41 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Fixed blank lines issues for pep8 Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py trunk/pyscard/src/smartcard/pyro/__init__.py trunk/pyscard/src/smartcard/pyro/server/__init__.py trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py trunk/pyscard/src/smartcard/wx/SimpleSCardAppFrame.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_listInterfaces.py 2011-10-16 10:51:41 UTC (rev 554) @@ -59,7 +59,6 @@ if hresult != SCARD_S_SUCCESS: raise error, 'Failed to introduce card type: ' + SCardGetErrorMessage(hresult) - # list card interfaces hresult, interfaces = SCardListInterfaces(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_locateCards.py 2011-10-16 10:51:41 UTC (rev 554) @@ -62,7 +62,6 @@ raise error, 'Failure to list cards' print 'Cards:', cards - readerstates = [] for i in xrange(len(readers)): readerstates += [(readers[i], SCARD_STATE_UNAWARE)] Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 10:51:41 UTC (rev 554) @@ -105,7 +105,6 @@ raise error, 'Failed to list readers in groups ' + repr(readerGroups) + ' : ' + SCardGetErrorMessage(hresult) print 'PCSC Readers in reader group', readerGroups, ':', readers - finally: hresult = SCardReleaseContext(hcontext) if hresult != SCARD_S_SUCCESS: Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py 2011-10-16 10:51:41 UTC (rev 554) @@ -153,7 +153,6 @@ boxsizerEvents = wx.StaticBoxSizer(staticboxEvents, wx.HORIZONTAL) boxsizerEvents.Add(self.feedbacktext, 0, wx.ALIGN_CENTER | wx.ALL, 5) - sizerboxTransmitButton = wx.BoxSizer(wx.HORIZONTAL) sizerboxTransmitButton.Add([20, 20], 0, wx.ALIGN_CENTER | wx.ALL, 5) self.transmitbutton = wx.Button(self, ID_TRANSMIT, "Transmit", wx.DefaultPosition, wx.DefaultSize, 0) Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/apdumanager.py 2011-10-16 10:51:41 UTC (rev 554) @@ -44,12 +44,12 @@ """ This will get us the program's directory, even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" - if we_are_frozen(): - return os.path.dirname( unicode(sys.executable, sys.getfilesystemencoding( )) ) + return os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( ))) return os.path.dirname(unicode(__file__, sys.getfilesystemencoding( ))) + def main(argv): app = SimpleSCardApp( appname='A tool to send apdu to a card', Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/setup.py 2011-10-16 10:51:41 UTC (rev 554) @@ -40,5 +40,3 @@ "py2exe":{"dll_excludes":["MSVCP90.dll"]} } ) - - Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:51:41 UTC (rev 554) @@ -31,6 +31,7 @@ ID_TEXT = 10000 + def we_are_frozen(): """Returns whether we are frozen via py2exe. This will affect how we find out where we are located. @@ -43,7 +44,6 @@ """ This will get us the program's directory, even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" - if we_are_frozen(): return os.path.dirname( unicode(sys.executable, sys.getfilesystemencoding( )) ) Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/setup.py 2011-10-16 10:51:41 UTC (rev 554) @@ -39,5 +39,3 @@ "py2exe":{"dll_excludes":["MSVCP90.dll"]} } ) - - Modified: trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py 2011-10-16 10:51:41 UTC (rev 554) @@ -73,7 +73,6 @@ childReader = self.tree.AppendItem(readerNode, repr(reader)) childCard = self.tree.AppendItem(childReader, getATR(reader)) - readerGroupNode = self.tree.AppendItem(self.tree.GetRootItem(), "Readers Groups") for readergroup in smartcard.System.readergroups(): childReaderGroup = self.tree.AppendItem(readerGroupNode, readergroup) Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/readerviewer.py 2011-10-16 10:51:41 UTC (rev 554) @@ -40,7 +40,6 @@ """ This will get us the program's directory, even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.""" - if we_are_frozen(): return os.path.dirname( unicode(sys.executable, sys.getfilesystemencoding( )) ) Modified: trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/Examples/wx/readerviewer/setup.py 2011-10-16 10:51:41 UTC (rev 554) @@ -40,5 +40,3 @@ "py2exe":{"dll_excludes":["MSVCP90.dll"]} } ) - - Modified: trunk/pyscard/src/smartcard/pyro/__init__.py =================================================================== --- trunk/pyscard/src/smartcard/pyro/__init__.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/pyro/__init__.py 2011-10-16 10:51:41 UTC (rev 554) @@ -1 +1,23 @@ +"""pyro (remote python) utility module. +__author__ = "http://www.gemalto.com" + +Copyright 2011 gemalto +Author: Jean-Daniel Aussel, mailto:jea...@ge... + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" Modified: trunk/pyscard/src/smartcard/pyro/server/__init__.py =================================================================== --- trunk/pyscard/src/smartcard/pyro/server/__init__.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/pyro/server/__init__.py 2011-10-16 10:51:41 UTC (rev 554) @@ -1 +1,23 @@ +"""pyro server utility module. +__author__ = "http://www.gemalto.com" + +Copyright 2011 gemalto +Author: Jean-Daniel Aussel, mailto:jea...@ge... + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" Modified: trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py 2011-10-16 10:51:41 UTC (rev 554) @@ -263,7 +263,6 @@ ErrorCheckingChain(errorchain, ISO7816_4ErrorChecker()), ErrorCheckingChain(errorchain, ISO7816_4_SW1ErrorChecker())] - # don't care about Warning Exceptions errorchain[0].addFilterException(smartcard.sw.SWExceptions.WarningProcessingException) Modified: trunk/pyscard/src/smartcard/wx/SimpleSCardAppFrame.py =================================================================== --- trunk/pyscard/src/smartcard/wx/SimpleSCardAppFrame.py 2011-10-16 10:40:43 UTC (rev 553) +++ trunk/pyscard/src/smartcard/wx/SimpleSCardAppFrame.py 2011-10-16 10:51:41 UTC (rev 554) @@ -73,7 +73,6 @@ boxsizer = wx.BoxSizer(wx.HORIZONTAL) - # create user dialog if None != apppanelclass: self.dialogpanel = apppanelclass(self) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 10:40:49
|
Revision: 553 http://pyscard.svn.sourceforge.net/pyscard/?rev=553&view=rev Author: jdaussel Date: 2011-10-16 10:40:43 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Replaced backticks with repr() Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py trunk/pyscard/src/smartcard/test/configcheck.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 10:34:40 UTC (rev 552) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_readerGroups.py 2011-10-16 10:40:43 UTC (rev 553) @@ -102,7 +102,7 @@ elif 'pcsclite' == resourceManager: hresult, readers = SCardListReaders(hcontext, readerGroups) if hresult != SCARD_S_SUCCESS: - raise error, 'Failed to list readers in groups ' + `readerGroups` + ' : ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to list readers in groups ' + repr(readerGroups) + ' : ' + SCardGetErrorMessage(hresult) print 'PCSC Readers in reader group', readerGroups, ':', readers Modified: trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py 2011-10-16 10:34:40 UTC (rev 552) +++ trunk/pyscard/src/smartcard/Examples/wx/apdumanager/SampleAPDUManagerPanel.py 2011-10-16 10:40:43 UTC (rev 553) @@ -59,38 +59,38 @@ """Called when a card is activated by double-clicking on the card or reader tree control or toolbar. In this sample, we just connect to the card on the first activation.""" SimpleSCardAppEventObserver.OnActivateCard(self, card) - self.feedbacktext.SetLabel('Activated card: ' + `card`) + self.feedbacktext.SetLabel('Activated card: ' + repr(card)) self.transmitbutton.Enable() def OnActivateReader(self, reader): """Called when a reader is activated by double-clicking on the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnActivateReader(self, reader) - self.feedbacktext.SetLabel('Activated reader: ' + `reader`) + self.feedbacktext.SetLabel('Activated reader: ' + repr(reader)) self.transmitbutton.Disable() def OnDeactivateCard(self, card): """Called when a card is deactivated in the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnActivateCard(self, card) - self.feedbacktext.SetLabel('Deactivated card: ' + `card`) + self.feedbacktext.SetLabel('Deactivated card: ' + repr(card)) self.transmitbutton.Disable() def OnDeselectCard(self, card): """Called when a card is selected by clicking on the card or reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnSelectCard(self, card) - self.feedbacktext.SetLabel('Deselected card: ' + `card`) + self.feedbacktext.SetLabel('Deselected card: ' + repr(card)) self.transmitbutton.Disable() def OnSelectCard(self, card): """Called when a card is selected by clicking on the card or reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnSelectCard(self, card) - self.feedbacktext.SetLabel('Selected card: ' + `card`) + self.feedbacktext.SetLabel('Selected card: ' + repr(card)) if hasattr(self.selectedcard, 'connection'): self.transmitbutton.Enable() def OnSelectReader(self, reader): """Called when a reader is selected by clicking on the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnSelectReader(self, reader) - self.feedbacktext.SetLabel('Selected reader: ' + `reader`) + self.feedbacktext.SetLabel('Selected reader: ' + repr(reader)) self.transmitbutton.Disable() # callbacks Modified: trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:34:40 UTC (rev 552) +++ trunk/pyscard/src/smartcard/Examples/wx/cardmonitor/cardmonitor.py 2011-10-16 10:40:43 UTC (rev 553) @@ -83,27 +83,27 @@ """Called when a card is activated by double-clicking on the card or reader tree control or toolbar. In this sample, we just connect to the card on the first activation.""" SimpleSCardAppEventObserver.OnActivateCard(self, card) - self.feedbacktext.SetLabel('Activated card: ' + `card`) + self.feedbacktext.SetLabel('Activated card: ' + repr(card)) def OnActivateReader(self, reader): """Called when a reader is activated by double-clicking on the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnActivateReader(self, reader) - self.feedbacktext.SetLabel('Activated reader: ' + `reader`) + self.feedbacktext.SetLabel('Activated reader: ' + repr(reader)) def OnDeactivateCard(self, card): """Called when a card is deactivated in the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnActivateCard(self, card) - self.feedbacktext.SetLabel('Deactivated card: ' + `card`) + self.feedbacktext.SetLabel('Deactivated card: ' + repr(card)) def OnSelectCard(self, card): """Called when a card is selected by clicking on the card or reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnSelectCard(self, card) - self.feedbacktext.SetLabel('Selected card: ' + `card`) + self.feedbacktext.SetLabel('Selected card: ' + repr(card)) def OnSelectReader(self, reader): """Called when a reader is selected by clicking on the reader tree control or toolbar.""" SimpleSCardAppEventObserver.OnSelectReader(self, reader) - self.feedbacktext.SetLabel('Selected reader: ' + `reader`) + self.feedbacktext.SetLabel('Selected reader: ' + repr(reader)) def main(argv): Modified: trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py 2011-10-16 10:34:40 UTC (rev 552) +++ trunk/pyscard/src/smartcard/Examples/wx/pcscdiag/pcscdiag.py 2011-10-16 10:40:43 UTC (rev 553) @@ -70,7 +70,7 @@ readerNode = self.tree.AppendItem(self.tree.GetRootItem(), "Readers") for reader in smartcard.System.readers(): - childReader = self.tree.AppendItem(readerNode, `reader`) + childReader = self.tree.AppendItem(readerNode, repr(reader)) childCard = self.tree.AppendItem(childReader, getATR(reader)) @@ -79,7 +79,7 @@ childReaderGroup = self.tree.AppendItem(readerGroupNode, readergroup) readers = smartcard.System.readers(readergroup) for reader in readers: - child = self.tree.AppendItem(childReaderGroup, `reader`) + child = self.tree.AppendItem(childReaderGroup, repr(reader)) def OnExpandAll(self): """ expand all nodes """ Modified: trunk/pyscard/src/smartcard/test/configcheck.py =================================================================== --- trunk/pyscard/src/smartcard/test/configcheck.py 2011-10-16 10:34:40 UTC (rev 552) +++ trunk/pyscard/src/smartcard/test/configcheck.py 2011-10-16 10:40:43 UTC (rev 553) @@ -60,7 +60,7 @@ expectedATRs.append([]) f.write('expectedATRs = ') #for atr in expectedATRs: print `toHexString(atr)` - f.write(`expectedATRs` + '\n') + f.write(repr(expectedATRs) + '\n') f.write('expectedATRinReader = {}\n') f.write('for i in xrange(len(expectedReaders)):\n') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 10:34:47
|
Revision: 552 http://pyscard.svn.sourceforge.net/pyscard/?rev=552&view=rev Author: jdaussel Date: 2011-10-16 10:34:40 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Replaced deprecated has_key() with in (pep8) Modified Paths: -------------- trunk/pyscard/src/smartcard/CardNames.py trunk/pyscard/src/smartcard/Session.py trunk/pyscard/src/smartcard/test/framework/testcase_Card.py trunk/pyscard/src/smartcard/test/framework/testcase_CardConnection.py trunk/pyscard/src/smartcard/test/framework/testcase_CardMonitor.py trunk/pyscard/src/smartcard/test/framework/testcase_CardService.py trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py trunk/pyscard/src/smartcard/test/framework/testcase_readermonitor.py trunk/pyscard/src/smartcard/test/framework/testcase_readermonitorstress.py trunk/pyscard/src/smartcard/test/framework/testcase_readers.py trunk/pyscard/src/smartcard/test/scard/testcase_getattrib.py trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py trunk/pyscard/src/smartcard/test/scard/testcase_locatecards.py Modified: trunk/pyscard/src/smartcard/CardNames.py =================================================================== --- trunk/pyscard/src/smartcard/CardNames.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/CardNames.py 2011-10-16 10:34:40 UTC (rev 552) @@ -64,7 +64,7 @@ def dump(self): for k, v in self.db.iteritems(): - print k, `loads(v)` + print k, repr(loads(v)) def find(self, atr, reader=None): for k, v in self.db.iteritems(): Modified: trunk/pyscard/src/smartcard/Session.py =================================================================== --- trunk/pyscard/src/smartcard/Session.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/Session.py 2011-10-16 10:34:40 UTC (rev 552) @@ -58,7 +58,7 @@ if readerName == None: if len(readers()) > 0: self.reader = readers()[0] - self.readerName = `self.reader` + self.readerName = repr(self.reader) else: raise NoReadersException() @@ -68,7 +68,7 @@ for reader in readers(): if readerName == str(reader): self.reader = reader - self.readerName = `self.reader` + self.readerName = repr(self.reader) try: self.reader Modified: trunk/pyscard/src/smartcard/test/framework/testcase_Card.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_Card.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_Card.py 2011-10-16 10:34:40 UTC (rev 552) @@ -65,7 +65,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "9f 20": 2, "6e 0": 3} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) @@ -83,7 +83,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "9f 20": 2, "6e 0": 3} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) Modified: trunk/pyscard/src/smartcard/test/framework/testcase_CardConnection.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_CardConnection.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_CardConnection.py 2011-10-16 10:34:40 UTC (rev 552) @@ -64,7 +64,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "6e 0": 2, "9f 20": 3, "9f 22": 4} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) cc.disconnect() @@ -81,7 +81,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "6e 0": 2, "9f 20": 3, "9f 22": 4} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) cc.disconnect() @@ -126,7 +126,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "6e 0": 2, "9f 20": 3, "9f 22": 4} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) cc.disconnect() @@ -143,7 +143,7 @@ response, sw1, sw2 = cc.transmit(SELECT + DF_TELECOM, CardConnection.T0_protocol) expectedSWs = {"9f 1a": 1, "6e 0": 2, "9f 20": 3, "9f 22": 4} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) else: self.assertRaises(NoCardException, cc.connect) cc.disconnect() Modified: trunk/pyscard/src/smartcard/test/framework/testcase_CardMonitor.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_CardMonitor.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_CardMonitor.py 2011-10-16 10:34:40 UTC (rev 552) @@ -63,7 +63,7 @@ foundcards[toHexString(card.atr)] = 1 for atr in expectedATRs: if [] != atr and {} != foundcards: - self.testcase.assert_(foundcards.has_key(toHexString(atr))) + self.testcase.assert_(toHexString(atr) in foundcards) class testthread(threading.Thread): Modified: trunk/pyscard/src/smartcard/test/framework/testcase_CardService.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_CardService.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_CardService.py 2011-10-16 10:34:40 UTC (rev 552) @@ -63,7 +63,7 @@ response, sw1, sw2 = cs.connection.transmit(SELECT + DF_TELECOM) expectedSWs = {"9f 1a": 1, "6e 0": 2, "9f 20": 3, "9f 22": 4} self.assertEquals([], response) - self.assert_(expectedSWs.has_key("%x %x" % (sw1, sw2)) or "9f" == "%x" % sw1) + self.assert_("%x %x" % (sw1, sw2) in expectedSWs or "9f" == "%x" % sw1) def suite(): Modified: trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_ErrorChecking.py 2011-10-16 10:34:40 UTC (rev 552) @@ -117,7 +117,7 @@ for sw1 in range(0x00, 0xff + 1): sw2range = [] exception = None - if tiso7816_4SW1.has_key(sw1): + if sw1 in tiso7816_4SW1: exception = tiso7816_4SW1[sw1] for sw2 in range(0x00, 0xff + 1): if None != exception: @@ -145,7 +145,7 @@ for sw1 in range(0x00, 0xff + 1): sw2range = [] - if tiso7816_4SW.has_key(sw1): + if sw1 in tiso7816_4SW: exception, sw2range = tiso7816_4SW[sw1] for sw2 in range(0x00, 0xff + 1): if sw2 in sw2range: @@ -169,7 +169,7 @@ for sw1 in range(0x00, 0xff + 1): sw2range = [] - if tiso7816_8SW.has_key(sw1): + if sw1 in tiso7816_8SW: exception, sw2range = tiso7816_8SW[sw1] for sw2 in range(0x00, 0xff + 1): if sw2 in sw2range: @@ -190,7 +190,7 @@ for sw1 in range(0x00, 0xff + 1): sw2range = [] - if tiso7816_9SW.has_key(sw1): + if sw1 in tiso7816_9SW: exception, sw2range = tiso7816_9SW[sw1] for sw2 in range(0x00, 0xff + 1): if sw2 in sw2range: @@ -217,7 +217,7 @@ for sw1 in range(0x00, 0xff + 1): sw2range = [] - if top21_SW.has_key(sw1): + if sw1 in top21_SW: exception, sw2range = top21_SW[sw1] for sw2 in range(0x00, 0xff + 1): if sw2 in sw2range: Modified: trunk/pyscard/src/smartcard/test/framework/testcase_readermonitor.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_readermonitor.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_readermonitor.py 2011-10-16 10:34:40 UTC (rev 552) @@ -62,7 +62,7 @@ foundreaders[str(reader)] = 1 if {} != foundreaders: for reader in expectedReaders: - self.testcase.assert_(foundreaders.has_key(reader)) + self.testcase.assert_(reader in foundreaders) class testthread(threading.Thread): Modified: trunk/pyscard/src/smartcard/test/framework/testcase_readermonitorstress.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_readermonitorstress.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_readermonitorstress.py 2011-10-16 10:34:40 UTC (rev 552) @@ -85,7 +85,7 @@ mutexvreaders.acquire() if newreader not in virtualreaders: virtualreaders.append(newreader) - if insertedreaderstats.has_key(newreader): + if newreader in insertedreaderstats: insertedreaderstats[newreader] += 1 else: insertedreaderstats[newreader] = 1 @@ -109,7 +109,7 @@ if virtualreaders: oldreader = random.choice(virtualreaders) virtualreaders.remove(oldreader) - if removedreaderstats.has_key(oldreader): + if oldreader in removedreaderstats: removedreaderstats[oldreader] += 1 else: removedreaderstats[oldreader] = 1 @@ -130,12 +130,12 @@ def update(self, observable, (addedreaders, removedreaders)): self.countnotified += 1 for newreader in addedreaders: - if self.insertedreaderstats.has_key(newreader): + if newreader in self.insertedreaderstats: self.insertedreaderstats[newreader] += 1 else: self.insertedreaderstats[newreader] = 1 for oldreader in removedreaders: - if self.removedreaderstats.has_key(oldreader): + if oldreader in self.removedreaderstats: self.removedreaderstats[oldreader] += 1 else: self.removedreaderstats[oldreader] = 1 Modified: trunk/pyscard/src/smartcard/test/framework/testcase_readers.py =================================================================== --- trunk/pyscard/src/smartcard/test/framework/testcase_readers.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/framework/testcase_readers.py 2011-10-16 10:34:40 UTC (rev 552) @@ -58,28 +58,28 @@ for reader in readers(): foundreaders[str(reader)] = 1 for reader in expectedReaders: - self.assert_(foundreaders.has_key(reader)) + self.assert_(reader in foundreaders) def testcase_legacyreaders(self): foundreaders = {} for reader in listReaders(): foundreaders[reader] = 1 for reader in expectedReaders: - self.assert_(foundreaders.has_key(reader)) + self.assert_(reader in foundreaders) def testcase_readers_in_readergroup(self): foundreaders = {} for reader in readers(['SCard$DefaultReaders']): foundreaders[str(reader)] = 1 for reader in expectedReaders: - self.assert_(foundreaders.has_key(reader)) + self.assert_(reader in foundreaders) def testcase_readers_in_readergroup_empty(self): foundreaders = {} for reader in readers([]): foundreaders[str(reader)] = 1 for reader in expectedReaders: - self.assert_(foundreaders.has_key(reader)) + self.assert_(reader in foundreaders) if 'winscard' == resourceManager: @@ -88,7 +88,7 @@ for reader in readers(['dummy$group']): foundreaders[reader] = 1 for reader in expectedReaders: - self.assert_(not foundreaders.has_key(reader)) + self.assert_(not reader in foundreaders) self.assertEquals(0, len(foundreaders)) def testcase_readergroups(self): @@ -96,7 +96,7 @@ for readergroup in readergroups(): foundreadergroups[readergroup] = 1 for readergroup in expectedReaderGroups: - self.assert_(foundreadergroups.has_key(readergroup)) + self.assert_(readergroup in foundreadergroups) def suite(): Modified: trunk/pyscard/src/smartcard/test/scard/testcase_getattrib.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_getattrib.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/scard/testcase_getattrib.py 2011-10-16 10:34:40 UTC (rev 552) @@ -69,7 +69,7 @@ self.assertEquals(reader, expectedReaders[r]) self.assertEquals(atr, expectedATRs[r]) - if scard.__dict__.has_key('SCARD_ATTR_ATR_STRING'): + if 'SCARD_ATTR_ATR_STRING' in scard.__dict__: hresult, attrib = SCardGetAttrib(hcard, SCARD_ATTR_ATR_STRING) self.assertEquals(hresult, 0) self.assertEquals(expectedATRs[r], attrib) Modified: trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/scard/testcase_listcards.py 2011-10-16 10:34:40 UTC (rev 552) @@ -128,7 +128,7 @@ for i in xrange(len(cards)): foundCards[cards[i]] = 1 for i in expectedCards: - self.assert_(foundCards.has_key(i)) + self.assert_(i in foundCards) # dummycard has a primary provider, other cards have no primary provider if 'Windows-7-6.1.7600'==platform.platform(): @@ -146,7 +146,7 @@ for i in xrange(len(cards)): hresult, providername = SCardGetCardTypeProviderName( self.hcontext, cards[i], SCARD_PROVIDER_PRIMARY) - if expectedPrimaryProviderResult.has_key(cards[i]): + if cards[i] in expectedPrimaryProviderResult: self.assertEquals(hresult, expectedPrimaryProviderResult[cards[i]][0]) if hresult == 0: self.assertEquals(providername, smartcard.guid.GUIDToStr(expectedPrimaryProviderResult[cards[i]][1])) @@ -167,7 +167,7 @@ for i in xrange(len(cards)): hresult, providername = SCardGetCardTypeProviderName( self.hcontext, cards[i], SCARD_PROVIDER_CSP) - if expectedProviderCSPResult.has_key(cards[i]): + if cards[i] in expectedProviderCSPResult: self.assertEquals(hresult, expectedProviderCSPResult[cards[i]][0]) self.assertEquals(providername, expectedProviderCSPResult[cards[i]][1]) Modified: trunk/pyscard/src/smartcard/test/scard/testcase_locatecards.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_locatecards.py 2011-10-16 10:15:14 UTC (rev 551) +++ trunk/pyscard/src/smartcard/test/scard/testcase_locatecards.py 2011-10-16 10:34:40 UTC (rev 552) @@ -62,7 +62,7 @@ for reader in readers: foundReaders[reader] = 1 for reader in expectedReaders: - self.assert_(foundReaders.has_key(reader)) + self.assert_(reader in foundReaders) if 'winscard' == resourceManager: hresult, cards = SCardListCards(self.hcontext, [], []) @@ -79,7 +79,7 @@ for reader in expectedReaders: dictexpectedreaders[reader] = 1 for reader, eventstate, atr in newstates: - if dictexpectedreaders.has_key(reader) and [] != expectedATRinReader[reader]: + if reader in dictexpectedreaders and [] != expectedATRinReader[reader]: self.assertEquals(expectedATRinReader[reader], atr) self.assert_(eventstate & SCARD_STATE_PRESENT) self.assert_(eventstate & SCARD_STATE_CHANGED) @@ -101,7 +101,7 @@ for reader in expectedReaders: dictexpectedreaders[reader] = 1 for reader, eventstate, atr in newstates: - if dictexpectedreaders.has_key(reader) and [] != expectedATRinReader[reader]: + if reader in dictexpectedreaders and [] != expectedATRinReader[reader]: self.assertEquals(expectedATRinReader[reader], atr) self.assert_(eventstate & SCARD_STATE_PRESENT) self.assert_(eventstate & SCARD_STATE_CHANGED) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2011-10-16 10:15:20
|
Revision: 551 http://pyscard.svn.sourceforge.net/pyscard/?rev=551&view=rev Author: jdaussel Date: 2011-10-16 10:15:14 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Replaced has_keys() by in (pep8) Modified Paths: -------------- trunk/pyscard/src/smartcard/sw/ISO7816_4ErrorChecker.py trunk/pyscard/src/smartcard/sw/ISO7816_4_SW1ErrorChecker.py trunk/pyscard/src/smartcard/sw/ISO7816_8ErrorChecker.py trunk/pyscard/src/smartcard/sw/ISO7816_9ErrorChecker.py trunk/pyscard/src/smartcard/sw/op21_ErrorChecker.py Modified: trunk/pyscard/src/smartcard/sw/ISO7816_4ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ISO7816_4ErrorChecker.py 2011-10-16 10:11:04 UTC (rev 550) +++ trunk/pyscard/src/smartcard/sw/ISO7816_4ErrorChecker.py 2011-10-16 10:15:14 UTC (rev 551) @@ -140,7 +140,7 @@ @param sw1, sw2: apdu data status words Derived classes must raise a L{smartcard.sw.SWException} upon error.""" - if iso7816_4SW.has_key(sw1): + if sw1 in iso7816_4SW: exception, sw2dir = iso7816_4SW[sw1] if type(sw2dir) == type({}): try: Modified: trunk/pyscard/src/smartcard/sw/ISO7816_4_SW1ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ISO7816_4_SW1ErrorChecker.py 2011-10-16 10:11:04 UTC (rev 550) +++ trunk/pyscard/src/smartcard/sw/ISO7816_4_SW1ErrorChecker.py 2011-10-16 10:15:14 UTC (rev 551) @@ -70,7 +70,7 @@ @param data: apdu response data @param sw1, sw2: apdu data status words """ - if iso7816_4SW1.has_key(sw1): + if sw1 in iso7816_4SW1: exception = iso7816_4SW1[sw1] raise exception(data, sw1, sw2) Modified: trunk/pyscard/src/smartcard/sw/ISO7816_8ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ISO7816_8ErrorChecker.py 2011-10-16 10:11:04 UTC (rev 550) +++ trunk/pyscard/src/smartcard/sw/ISO7816_8ErrorChecker.py 2011-10-16 10:15:14 UTC (rev 551) @@ -110,7 +110,7 @@ @param sw1, sw2: apdu data status words Derived classes must raise a L{smartcard.sw.SWException} upon error.""" - if iso7816_8SW.has_key(sw1): + if sw1 in iso7816_8SW: exception, sw2dir = iso7816_8SW[sw1] if type(sw2dir) == type({}): try: Modified: trunk/pyscard/src/smartcard/sw/ISO7816_9ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/ISO7816_9ErrorChecker.py 2011-10-16 10:11:04 UTC (rev 550) +++ trunk/pyscard/src/smartcard/sw/ISO7816_9ErrorChecker.py 2011-10-16 10:15:14 UTC (rev 551) @@ -76,7 +76,7 @@ @param sw1, sw2: apdu data status words Derived classes must raise a L{smartcard.sw.SWException} upon error.""" - if iso7816_9SW.has_key(sw1): + if sw1 in iso7816_9SW: exception, sw2dir = iso7816_9SW[sw1] if type(sw2dir) == type({}): try: Modified: trunk/pyscard/src/smartcard/sw/op21_ErrorChecker.py =================================================================== --- trunk/pyscard/src/smartcard/sw/op21_ErrorChecker.py 2011-10-16 10:11:04 UTC (rev 550) +++ trunk/pyscard/src/smartcard/sw/op21_ErrorChecker.py 2011-10-16 10:15:14 UTC (rev 551) @@ -104,7 +104,7 @@ @param sw1, sw2: apdu data status words Derived classes must raise a L{smartcard.sw.SWException} upon error.""" - if op21_SW.has_key(sw1): + if sw1 in op21_SW: exception, sw2dir = op21_SW[sw1] if type(sw2dir) == type({}): try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |