Commit 44c47c32 authored by Ludovic Rousseau's avatar Ludovic Rousseau

sort_smartcard_list: use new open() syntax

parent 8315edf6
......@@ -7,21 +7,22 @@ import pprint
pp = pprint.PrettyPrinter(indent=4)
ATRs = list()
for l in file("smartcard_list.txt").readlines():
if l.endswith(" \n") or l.endswith("\t\n"):
print("Trailing space in:", l)
with open("smartcard_list.txt", "r") as f:
for l in f.readlines():
if l.endswith(" \n") or l.endswith("\t\n"):
print("Trailing space in:", l)
if l == "\n":
continue
if l == "\n":
continue
if l.startswith("#") or l.startswith("\t"):
continue
if l.startswith("#") or l.startswith("\t"):
continue
# check the ATR is all upper case
if l.upper() != l:
print("error:", l)
# check the ATR is all upper case
if l.upper() != l:
print("error:", l)
ATRs.append(l.strip())
ATRs.append(l.strip())
# if l.startswith("\t"):
# ATRs.append([atr, l.strip()])
# else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment