[Pcsclite-cvs-commit] r4960 - in /website: default.css matrix.py webpage.template

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue May 25 13:40:59 UTC 2010


Author: rousseau
Date: Tue May 25 13:40:52 2010
New Revision: 4960

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4960
Log:
add the CCID release with supporting each reader

Modified:
    website/default.css
    website/matrix.py
    website/webpage.template

Modified: website/default.css
URL: http://svn.debian.org/wsvn/pcsclite/website/default.css?rev=4960&op=diff
==============================================================================
--- website/default.css (original)
+++ website/default.css Tue May 25 13:40:52 2010
@@ -23,3 +23,4 @@
 span.note{background:pink;}
 span.features{background:yellow;}
 span.url{}
+span.release{color:Grey;}

Modified: website/matrix.py
URL: http://svn.debian.org/wsvn/pcsclite/website/matrix.py?rev=4960&op=diff
==============================================================================
--- website/matrix.py (original)
+++ website/matrix.py Tue May 25 13:40:52 2010
@@ -23,6 +23,7 @@
 import pprint
 import templayer
 import time
+import re
 
 pp = pprint.PrettyPrinter(indent=4)
 
@@ -155,6 +156,94 @@
     #pp.pprint(supported_readers)
 
 
+def get_driver_version(readers):
+    """
+    set the 'release' field for each reader
+    """
+    changelog = get_changelog()
+
+    for reader in readers.keys():
+        rev = get_driver_revision(reader, changelog)
+        readers[reader]['release'] = driver_revision_to_version(rev)
+
+
+def driver_revision_to_version(rev):
+    """
+    convert a SVN revision in the first release containing this revision
+    """
+    history = [
+        #[ SVN revision, CCID release ]
+        [4931, "1.3.12"],
+        [4347, "1.3.11"],
+        [3338, "1.3.10"],
+        [3208, "1.3.9"],
+        [3033, "1.3.8"],
+        [2985, "1.3.7"],
+        [2924, "1.3.6"],
+        [2842, "1.3.5"],
+        [2809, "1.3.4"],
+        [2796, "1.3.3"],
+        [2755, "1.3.2"],
+        [2692, "1.3.1"],
+        [2522, "1.3.0"],
+        [2363, "1.2.1"],
+        [2345, "1.2.0"],
+        [2135, "1.1.0"],
+        [2020, "1.0.1"],
+        [1911, "1.0.0"],
+        [1761, "0.9.4"],
+        [1400, "0.9.3"],
+        [1186, "0.9.2"],
+        [1018, "0.9.1"],
+        [1015, "0.9.0"],
+        [703, "0.4.1"],
+        [697, "0.4.0"],
+        [552, "0.3.2"],
+        [467, "0.3.1"],
+        [423, "0.3.0"],
+        [342, "0.2.0"],
+        [273, "0.1.0"]]
+    for h in history:
+        if rev >= h[0]:
+            return h[1]
+
+
+def get_changelog():
+    """
+    read a complete svn2cl Changelog file and merge commits on one line
+    """
+    lines = open("readers/ChangeLog").readlines()
+    changelog = list()
+    p = list()
+
+    for line in lines:
+        # the lines starts with a year (2000-2099)
+        if line.startswith('20'):
+            changelog.append("".join(p).replace('\n', ''))
+            p = [line]
+        else:
+            p.append(line)
+
+    return changelog
+
+
+def get_driver_revision(reader, changelog):
+    """
+    search a log line containing the reader string
+    """
+    for line in changelog:
+        if reader  in line:
+            found = line
+
+    if found:
+        result = re.search('\\* \\[r(\d*)\\]', found)
+        if result:
+            # revision is the inner matching pattern
+            return int(result.group(1))
+    else:
+        print "reader: %s not found in log", reader
+
+
 def get_by_manufacturer(readers):
     """
     return a dict of the readers grouped by manufacturer
@@ -210,6 +299,9 @@
             note = readers[r].get('note', "").split('\n')
             for n in note:
                 note_layer.write_layer('note', contents=n)
+
+            note_layer.write_layer('release',
+                release=readers[r]['release'])
 
     file_writer.close()
 
@@ -305,7 +397,8 @@
             'dwMaxDataRate', 'dwMaxIFSD', 'dwSynchProtocols',
             'dwMechanical', 'dwFeatures', 'dwMaxCCIDMessageLength',
             'bClassGetResponse', 'bClassEnveloppe', 'wLcdLayout',
-            'bPINSupport', 'bMaxCCIDBusySlots', 'features', 'note']
+            'bPINSupport', 'bMaxCCIDBusySlots', 'features', 'note',
+            'release']
 
     for f in fields:
         index = list()
@@ -339,6 +432,10 @@
     check_list(path, all_readers.keys())
     check_supported(path, all_readers)
 
+    get_driver_version(supported_readers)
+    get_driver_version(shouldwork_readers)
+    get_driver_version(unsupported_readers)
+
     generate_page("supported", "Supported CCID readers/ICCD tokens", "If you are a reader manufacturer and your reader is not listed here then contact me at ludovic.rousseau at free.fr", supported_readers)
     generate_page("shouldwork", "Should work but untested by me", "The CCID readers and ICCD tokens listed bellow should work with the driver but have not be validated by me. I would like to get these readers to perform test and validation and move them in the supported list above. If you are one of the manufacturers, please, contact me at ludovic.rousseau at free.fr.", shouldwork_readers)
     generate_page("unsupported", "Unsupported or partly supported CCID readers", "These readers have problems or serious limitations.", unsupported_readers)

Modified: website/webpage.template
URL: http://svn.debian.org/wsvn/pcsclite/website/webpage.template?rev=4960&op=diff
==============================================================================
--- website/webpage.template (original)
+++ website/webpage.template Tue May 25 13:40:52 2010
@@ -56,6 +56,10 @@
         <p><span class="features">Features: %features%</span></p>
         {/features}
 
+        {release}
+        <p><span class="release">In CCID release: %release%</span></p>
+        {/release}
+
     {/contents}
     <hr>
     <p>Generated on %date%.</p>




More information about the Pcsclite-cvs-commit mailing list