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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun May 15 15:30:03 UTC 2011


Author: rousseau
Date: Sun May 15 15:29:56 2011
New Revision: 5756

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5756
Log:
Some more pylint improvements

Modified:
    website/matrix.py

Modified: website/matrix.py
URL: http://svn.debian.org/wsvn/pcsclite/website/matrix.py?rev=5756&op=diff
==============================================================================
--- website/matrix.py (original)
+++ website/matrix.py Sun May 15 15:29:56 2011
@@ -31,13 +31,6 @@
 
 #pp = pprint.PrettyPrinter(indent=4)
 
-html_escape_table = {
-    "&": "&",
-    '"': """,
-    ">": ">",
-    "<": "&lt;",
-    }
-
 CCID_CLASS_CHARACTER = 0x00000000
 CCID_CLASS_TPDU = 0x00010000
 CCID_CLASS_SHORT_APDU = 0x00020000
@@ -47,6 +40,13 @@
 
 def html_escape(text):
     """Produce entities within text."""
+    html_escape_table = {
+        "&": "&amp;",
+        '"': "&quot;",
+        ">": "&gt;",
+        "<": "&lt;",
+        }
+
     result = list()
     for char in text:
         result.append(html_escape_table.get(char, char))
@@ -382,13 +382,13 @@
         title=title, comment=comment, section=section)
 
     # for each manufacturer
-    for m in manufacturers:
-        main_layer.write_layer('manufacturer', manufacturer=m)
+    for manufacturer in manufacturers:
+        main_layer.write_layer('manufacturer', manufacturer=manufacturer)
 
         # for each reader
-        for reader in sorted(manufacturer_readers[m]):
+        for reader in sorted(manufacturer_readers[manufacturer]):
             note_layer = main_layer.open_layer('reader',
-                manufacturer=m,
+                manufacturer=manufacturer,
                 product=readers[reader]['iProduct'],
                 idVendor=readers[reader]['idVendor'],
                 idProduct=readers[reader]['idProduct'],
@@ -401,7 +401,7 @@
             if url:
                 note_layer.write_layer('url',
                     url=url,
-                    manufacturer=m,
+                    manufacturer=manufacturer,
                     product=readers[reader]['iProduct'])
 
             features = ", ".join(readers[reader]['features'])
@@ -607,7 +607,11 @@
         # SVN version
         return 99 * 1000 * 1000
 
-if __name__ == "__main__":
+
+def main():
+    """
+    Generate every thing
+    """
     path = "ccid/readers/"
 
     supported_readers = parse_ini(path, "supported")
@@ -636,3 +640,7 @@
     generate_page("disabled", "Disabled CCID readers", "These readers are not even recognized by the driver because they are too bogus or because they are supported by another driver.", disabled_readers)
 
     generate_tables(all_readers)
+
+
+if __name__ == "__main__":
+    main()




More information about the Pcsclite-cvs-commit mailing list