[Pcsclite-cvs-commit] r4788 - /trunk/PCSC/UnitaryTests/control_switch_interface.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Mar 3 19:54:46 UTC 2010


Author: rousseau
Date: Wed Mar  3 19:54:45 2010
New Revision: 4788

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4788
Log:
make pylint happier

Modified:
    trunk/PCSC/UnitaryTests/control_switch_interface.py

Modified: trunk/PCSC/UnitaryTests/control_switch_interface.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/control_switch_interface.py?rev=4788&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/control_switch_interface.py (original)
+++ trunk/PCSC/UnitaryTests/control_switch_interface.py Wed Mar  3 19:54:45 2010
@@ -1,7 +1,9 @@
 #! /usr/bin/env python
 
+"""
 #   control_switch_interface.py: switch interface on the GemProx DU
-#   Copyright (C) 2009  Ludovic Rousseau
+#   Copyright (C) 2009-2010  Ludovic Rousseau
+"""
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -18,21 +20,25 @@
 #   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 from smartcard.pcsc.PCSCReader import readers
-from smartcard.pcsc.PCSCPart10 import *
-from smartcard.util import toHexString
+from smartcard.pcsc.PCSCPart10 import (SCARD_SHARE_DIRECT,
+    SCARD_LEAVE_CARD, SCARD_CTL_CODE)
+
+IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE = SCARD_CTL_CODE(1)
 
 
 def switch_interface(interface):
+    """
+    switch from contact to contactless (or reverse) on a GemProx DU reader
+    """
     for reader in readers():
         cardConnection = reader.createConnection()
         cardConnection.connect(mode=SCARD_SHARE_DIRECT, disposition=SCARD_LEAVE_CARD)
 
-        switch_interface = [0x52, 0xF8, 0x04, 0x01, 0x00, interface]
-        IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE = SCARD_CTL_CODE(1)
+        switch_interface_cmd = [0x52, 0xF8, 0x04, 0x01, 0x00, interface]
         print "Reader:", reader, "=>",
         try:
             res = cardConnection.control(IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE,
-                switch_interface)
+                switch_interface_cmd)
         except:
             print "FAILED"
         else:




More information about the Pcsclite-cvs-commit mailing list