Change tabs to 4 spaces in python files

This commit is contained in:
Ondrej Mikle 2017-10-22 17:27:44 +02:00
parent 5d41737f80
commit 2482462a73
6 changed files with 420 additions and 420 deletions

View file

@ -5,8 +5,8 @@ from nfc_smartcard import NFCDevice, NFCError
from binascii import hexlify
def formatAPDU(apdu):
return " ".join(["%02X" % ord(b) for b in apdu])
return " ".join(["%02X" % ord(b) for b in apdu])
tests = {
# Reading of file E104, where usually NDEF message is
"ndef4": [
@ -55,26 +55,26 @@ hex_apdus = tests[apdu_test]
apdus = [hex_apdu.replace(" ","").decode("hex") for hex_apdu in hex_apdus]
try:
nfc = NFCDevice()
uid = nfc.scanUID()
print "UID", hexlify(uid)
#nfc.close()
#nfc.open()
nfc = NFCDevice()
uid = nfc.scanUID()
print "UID", hexlify(uid)
#nfc.close()
#nfc.open()
print "Now trying to send ISO14443-4 APDUs"
try:
#nfc.selectPassiveTarget()
for apdu in apdus:
print "Command APDU:", formatAPDU(apdu)
rapdu = nfc.sendAPDU(apdu)
print "Response APDU valid: %s, SW %04x, data %s" % (rapdu.valid(), rapdu.sw(), hexlify(rapdu.data()))
except NFCError, e:
print "Failed to transmit APDU:", e.what()
print "Now trying to send ISO14443-4 APDUs"
try:
#nfc.selectPassiveTarget()
for apdu in apdus:
print "Command APDU:", formatAPDU(apdu)
rapdu = nfc.sendAPDU(apdu)
print "Response APDU valid: %s, SW %04x, data %s" % (rapdu.valid(), rapdu.sw(), hexlify(rapdu.data()))
except NFCError, e:
print "Failed to transmit APDU:", e.what()
print "Device is opened:", nfc.opened()
print "Closing device"
nfc.close()
print "Device is opened:", nfc.opened()
nfc.unload()
print "Device is opened:", nfc.opened()
print "Closing device"
nfc.close()
print "Device is opened:", nfc.opened()
nfc.unload()
except NFCError, e:
print "Reading UID failed:", e.what()
print "Reading UID failed:", e.what()