[Pcsclite-cvs-commit] r6190 - /website/generate_supported_readers.py
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Mon Jan 23 13:48:34 UTC 2012
Author: rousseau
Date: Mon Jan 23 13:48:33 2012
New Revision: 6190
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6190
Log:
Generate the "duplicates" section
Some devices have the same VID/PID than others. These duplicates are
listed in this new section.
Modified:
website/generate_supported_readers.py
Modified: website/generate_supported_readers.py
URL: http://svn.debian.org/wsvn/pcsclite/website/generate_supported_readers.py?rev=6190&op=diff
==============================================================================
--- website/generate_supported_readers.py (original)
+++ website/generate_supported_readers.py Mon Jan 23 13:48:33 2012
@@ -111,6 +111,34 @@
return manual_names
+def generate_duplicates(output_file, section, readers, manual_names):
+ """
+ Generate a section of duplicated VID/PID
+ """
+
+ output_file.write("##########################\n")
+ output_file.write("# section: " + section + "\n")
+ output_file.write("##########################\n")
+
+ vidpids = dict()
+ for reader in readers:
+ vidpid = readers[reader]['idVendor'] + ":" + \
+ readers[reader]['idProduct']
+ if vidpid not in vidpids:
+ vidpids[vidpid] = list()
+
+ vidpids[vidpid].append(reader)
+
+ for vidpid in vidpids:
+ if len(vidpids[vidpid]) > 1:
+ for reader in vidpids[vidpid]:
+ name = "%s %s" % (readers[reader]['iManufacturer'],
+ readers[reader]['iProduct'])
+ output_file.write("#%s:%s (%s)\n" % (vidpid, name,
+ reader))
+ output_file.write("\n")
+
+
def main():
"""
Generate every thing
@@ -134,6 +162,15 @@
manual_names)
generate_section(output_file, "disabled", disabled_readers,
manual_names)
+
+ # all_readers contain 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)
+
+ generate_duplicates(output_file, "duplicates", all_readers, manual_names)
+
output_file.close()
if __name__ == "__main__":
More information about the Pcsclite-cvs-commit
mailing list