[Pcsclite-cvs-commit] r3411 - /website/matrix.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Apr 7 14:03:20 UTC 2009


Author: rousseau
Date: Tue Apr  7 14:03:19 2009
New Revision: 3411

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3411
Log:
manage features as a list

Modified:
    website/matrix.py

Modified: website/matrix.py
URL: http://svn.debian.org/wsvn/pcsclite/website/matrix.py?rev=3411&op=diff
==============================================================================
--- website/matrix.py (original)
+++ website/matrix.py Tue Apr  7 14:03:19 2009
@@ -71,21 +71,19 @@
     readers = parse_all(path, reader_list)
     for r in readers.keys():
         for o in config.options(r):
-            readers[r][o] = config.get(r, o)
+            if o == 'features':
+                # for the features we use a list
+                readers[r][o] = [ config.get(r, o) ]
+            else:
+                readers[r][o] = config.get(r, o)
 
         bPINSupport = int(readers[r]['bPINSupport'], 16)
+        if bPINSupport != 0 and not 'features' in readers[r]:
+            readers[r]['features'] = list()
         if bPINSupport & 1:
-            if 'features' in readers[r]:
-                readers[r]['features'] += ", "
-            else:
-                readers[r]['features'] = ""
-            readers[r]['features'] += "PIN Verification"
+            readers[r]['features'].append("PIN Verification")
         if bPINSupport & 2:
-            if 'features' in readers[r]:
-                readers[r]['features'] += ", "
-            else:
-                readers[r]['features'] = ""
-            readers[r]['features'] += "PIN Modification"
+            readers[r]['features'].append("PIN Modification")
 
     #pp.pprint(readers["GemPCPinpad.txt"])
     return readers
@@ -151,7 +149,7 @@
                     manufacturer = m,
                     product = readers[r]['iProduct'])
             
-            features = readers[r].get('features', "")
+            features = ", ".join(readers[r].get('features', ""))
             if features:
                 note_layer.write_layer('features', features = features)
 




More information about the Pcsclite-cvs-commit mailing list