sort attribute for testing purpose tls-sprint
authorsylvain.thenault@logilab.fr
Mon, 04 May 2009 15:46:40 +0200
branchtls-sprint
changeset 1647 9936aca2453d
parent 1646 88182252fd11
child 1648 4735d7e77a82
sort attribute for testing purpose
common/tags.py
common/uilib.py
--- a/common/tags.py	Mon May 04 13:36:31 2009 +0200
+++ b/common/tags.py	Mon May 04 15:46:40 2009 +0200
@@ -36,8 +36,9 @@
         attrs['multiple'] = 'multiple'
     if id:
         attrs['id'] = id
-    html = [u'<select name="%s" %s>' % (
-        name, ' '.join('%s="%s"' % kv for kv in attrs.items()))]
+    attrs['name'] = name
+    html = [u'<select %s>' % ' '.join('%s="%s"' % kv
+                                      for kv in sorted(attrs.items()))]
     html += options
     html.append(u'</select>')
     return u'\n'.join(html)
--- a/common/uilib.py	Mon May 04 13:36:31 2009 +0200
+++ b/common/uilib.py	Mon May 04 15:46:40 2009 +0200
@@ -214,7 +214,7 @@
         except KeyError:
             pass
         value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value)))
-                                  for attr, value in attrs.items()
+                                  for attr, value in sorted(attrs.items())
                                   if value is not None)
     if content:
         if escapecontent: