[wwwsearch-commits] r56170 - wwwsearch/ClientForm/trunk

jjlee at codespeak.net jjlee at codespeak.net
Sun Jun 29 19:44:27 CEST 2008


Author: jjlee
Date: Sun Jun 29 19:44:25 2008
New Revision: 56170

Modified:
   wwwsearch/ClientForm/trunk/ClientForm.py
   wwwsearch/ClientForm/trunk/test.py
Log:
Don't eagerly close label when the element for that label is seen, since there may be more label text to follow (marius at gedmin.as)

Modified: wwwsearch/ClientForm/trunk/ClientForm.py
==============================================================================
--- wwwsearch/ClientForm/trunk/ClientForm.py	(original)
+++ wwwsearch/ClientForm/trunk/ClientForm.py	Sun Jun 29 19:44:25 2008
@@ -665,9 +665,7 @@
     def _add_label(self, d):
         #debug("%s", d)
         if self._current_label is not None:
-            if self._current_label["__taken"]:
-                self.end_label()  # be fuzzy
-            else:
+            if not self._current_label["__taken"]:
                 self._current_label["__taken"] = True
                 d["__label"] = self._current_label
 

Modified: wwwsearch/ClientForm/trunk/test.py
==============================================================================
--- wwwsearch/ClientForm/trunk/test.py	(original)
+++ wwwsearch/ClientForm/trunk/test.py	Sun Jun 29 19:44:25 2008
@@ -2986,6 +2986,8 @@
   <label><input type="radio" name="b" value="2" id="2"></input> Two</label>
   <input type="radio" name="b" value="3" id="3"></input>
       <label for="3">Three</label>
+  <label for="4"><input type="radio" name="b" value="4" id="4"></input>
+      Four</label>
 
   <select name="c" id="cselect" blah="foo">
     <option id="coption1" blah="bar">1</option>
@@ -3068,6 +3070,8 @@
                          [None])
         self.assertEqual(form.possible_items('a', by_label=True),
                          ['One', 'Two', 'Three'])
+        self.assertEqual(form.possible_items('b', by_label=True),
+                         ['One', 'Two', 'Three', 'Four'])
         reset_deprecations()
 
     def test_set_all_readonly(self):


More information about the wwwsearch-commits mailing list