[Pcsclite-git-commit] [website] 02/02: Script to extract some specific readers
Ludovic Rousseau
rousseau at moszumanska.debian.org
Mon May 4 15:46:04 UTC 2015
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository website.
commit 265ee9911068c628570cc020c04369175c412141
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date: Mon May 4 17:45:17 2015 +0200
Script to extract some specific readers
Generate a HTML list of readers that match some criteria.
---
get_readers.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/get_readers.py b/get_readers.py
new file mode 100755
index 0000000..eb92898
--- /dev/null
+++ b/get_readers.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+"""
+# get_readers.py: get specific readers
+# Copyright (C) 2015 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.
+"""
+
+# $Id: calculate_stats.py 6722 2013-08-08 20:08:05Z rousseau $
+
+from matrix import parse_ini
+
+path = "../trunk/Drivers/ccid/readers/"
+
+
+def display_reader_list(all_readers, readers):
+ # HTML list
+ for reader in readers:
+ print '<li>' + all_readers[reader]['iProduct'] + ' (' + reader + ')'
+ try:
+ print '<img src="https://pcsclite.alioth.debian.org/ccid/img/' + all_readers[reader]['image'] + '">'
+ except KeyError:
+ pass
+ print '</li>'
+
+
+def get_all_readers():
+ """ returns the list of all readers """
+
+ supported_readers = parse_ini(path, "supported")
+ shouldwork_readers = parse_ini(path, "shouldwork")
+ unsupported_readers = parse_ini(path, "unsupported")
+ #disabled_readers = parse_ini(path, "disabled")
+
+ # all_readers contains the union of the 3 lists
+ all_readers = dict(supported_readers)
+ all_readers.update(shouldwork_readers)
+ all_readers.update(unsupported_readers)
+ #all_readers.update(disabled_readers)
+
+ return all_readers
+
+if __name__ == "__main__":
+ all_readers = get_all_readers()
+
+ result = list()
+ for reader in all_readers:
+ if all_readers[reader]['idVendor'] == '0x08E6':
+ #if all_readers[reader]['iManufacturer'] == 'Axalto':
+ #if all_readers[reader]['idProduct'] == '0x1400':
+ result.append(reader)
+
+ display_reader_list(all_readers, result)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/website.git
More information about the Pcsclite-cvs-commit
mailing list