[Pcsclite-cvs-commit] r4287 - /website/short_apdu_readers.py
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Jun 30 09:18:32 UTC 2009
Author: rousseau
Date: Tue Jun 30 09:18:31 2009
New Revision: 4287
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4287
Log:
script to find short APDU readers
Added:
website/short_apdu_readers.py (with props)
Added: website/short_apdu_readers.py
URL: http://svn.debian.org/wsvn/pcsclite/website/short_apdu_readers.py?rev=4287&op=file
==============================================================================
--- website/short_apdu_readers.py (added)
+++ website/short_apdu_readers.py Tue Jun 30 09:18:31 2009
@@ -1,0 +1,62 @@
+#!/usr/bin/env python
+
+# short_apdu_readers.py get a list of short APDU readers
+# Copyright (C) 2009 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from matrix import *
+import sys
+
+def get_extended_apdu_readers(readers):
+ l = []
+ for r in readers.keys():
+ # TPDU level exchanges with CCID
+ if (int(readers[r]['dwFeatures'],16) & 0x70000) == 0x10000:
+ l.append(r)
+ # Short and Extended APDU level exchange with CCID
+ if (int(readers[r]['dwFeatures'],16) & 0x70000) == 0x40000:
+ l.append(r)
+
+ return l
+
+def get_short_apdu_readers(readers):
+ l = []
+ for r in readers.keys():
+ # Short APDU level exchange with CCID
+ if (int(readers[r]['dwFeatures'],16) & 0x70000) == 0x20000:
+ l.append(r)
+
+ return l
+
+if __name__ == "__main__":
+ path = "../trunk/Drivers/ccid/readers/"
+
+ supported_readers = parse_ini(path, "supported")
+ shouldwork_readers = parse_ini(path, "shouldwork")
+ unsupported_readers = parse_ini(path, "unsupported")
+
+ # all_readers contain the union of the 3 lists
+ all_readers = dict(supported_readers)
+ all_readers.update(shouldwork_readers)
+ all_readers.update(unsupported_readers)
+
+ if len(sys.argv) > 1:
+ l = get_extended_apdu_readers(all_readers)
+ else:
+ l = get_short_apdu_readers(all_readers)
+ l.sort()
+ for r in l:
+ print '<li>%s <a href="%s.html#%s%s">%s</a></li>' % (all_readers[r]['iManufacturer'], all_readers[r]['section'], all_readers[r]['idVendor'], all_readers[r]['idProduct'], all_readers[r]['iProduct'])
Propchange: website/short_apdu_readers.py
------------------------------------------------------------------------------
svn:executable = *
More information about the Pcsclite-cvs-commit
mailing list