[Pcsclite-cvs-commit] r6713 - website

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Mon Aug 5 19:37:07 UTC 2013


Author: rousseau
Date: 2013-08-05 19:37:06 +0000 (Mon, 05 Aug 2013)
New Revision: 6713

Modified:
   website/generate_supported_readers.py
Log:
Do not create 2 entries for the same VID:PID


Modified: website/generate_supported_readers.py
===================================================================
--- website/generate_supported_readers.py	2013-08-05 19:11:47 UTC (rev 6712)
+++ website/generate_supported_readers.py	2013-08-05 19:37:06 UTC (rev 6713)
@@ -44,7 +44,8 @@
     output_file.write("\n")
 
 
-def generate_section(output_file, section, readers, manual_names):
+def generate_section(output_file, section, readers, manual_names,
+        already_done):
     """
     Generate a section sorted by VID, PID
     """
@@ -75,6 +76,12 @@
         for (pid, reader) in manuf_readers:
             key = "%s:%s" % (readers[reader]['idVendor'],
                 readers[reader]['idProduct'])
+
+            # do not create 2 entries for the same VID:PID
+            if key in already_done:
+                continue
+            already_done.append(key)
+
             name = "%s %s" % (readers[reader]['iManufacturer'],
                 readers[reader]['iProduct'])
             output_file.write("%s%s:%s\n" % (state, key, name))
@@ -160,14 +167,15 @@
     manual_names = parse_supported_readers("ccid/readers/supported_readers.txt")
 
     generate_header(output_file)
+    alreay_done = list()
     generate_section(output_file, "supported", supported_readers,
-        manual_names)
+        manual_names, alreay_done)
     generate_section(output_file, "shouldwork", shouldwork_readers,
-        manual_names)
+        manual_names, alreay_done)
     generate_section(output_file, "unsupported", unsupported_readers,
-        manual_names)
+        manual_names, alreay_done)
     generate_section(output_file, "disabled", disabled_readers,
-        manual_names)
+        manual_names, alreay_done)
 
     # all_readers contain the union of the 3 lists
     all_readers = dict(supported_readers)




More information about the Pcsclite-cvs-commit mailing list