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

jjlee at codespeak.net jjlee at codespeak.net
Fri Sep 16 23:22:57 CEST 2005


Author: jjlee
Date: Fri Sep 16 23:22:56 2005
New Revision: 17608

Modified:
   wwwsearch/ClientForm/trunk/ClientForm.py
Log:
Move the new 'label' arguments to end of argument lists to avoid further breaking backwards-compatibility with version 0.1, since docs did not require callers to always use named arguments

Modified: wwwsearch/ClientForm/trunk/ClientForm.py
==============================================================================
--- wwwsearch/ClientForm/trunk/ClientForm.py	(original)
+++ wwwsearch/ClientForm/trunk/ClientForm.py	Fri Sep 16 23:22:56 2005
@@ -2742,15 +2742,15 @@
 # Form-filling methods applying only to ListControls.
 
     def possible_items(self, # deprecated
-                       name=None, type=None, kind=None, id=None, label=None,
-                       nr=None, by_label=False):
+                       name=None, type=None, kind=None, id=None,
+                       nr=None, by_label=False, label=None):
         """Return a list of all values that the specified control can take."""
         c = self._find_list_control(name, type, kind, id, label, nr)
         return c.possible_items(by_label)
 
     def set(self, selected, item_name, # deprecated
-            name=None, type=None, kind=None, id=None, label=None, nr=None,
-            by_label=False):
+            name=None, type=None, kind=None, id=None, nr=None,
+            by_label=False, label=None):
         """Select / deselect named list item.
 
         selected: boolean selected state
@@ -2759,15 +2759,15 @@
         self._find_list_control(name, type, kind, id, label, nr).set(
             selected, item_name, by_label)
     def toggle(self, item_name, # deprecated
-               name=None, type=None, kind=None, id=None, label=None, nr=None,
-               by_label=False):
+               name=None, type=None, kind=None, id=None, nr=None,
+               by_label=False, label=None):
         """Toggle selected state of named list item."""
         self._find_list_control(name, type, kind, id, label, nr).toggle(
             item_name, by_label)
 
     def set_single(self, selected, # deprecated
-                   name=None, type=None, kind=None, id=None, label=None,
-                   nr=None, by_label=None):
+                   name=None, type=None, kind=None, id=None,
+                   nr=None, by_label=None, label=None):
         """Select / deselect list item in a control having only one item.
 
         If the control has multiple list items, ItemCountError is raised.
@@ -2786,7 +2786,7 @@
         self._find_list_control(
             name, type, kind, id, label, nr).set_single(selected)
     def toggle_single(self, name=None, type=None, kind=None, id=None,
-                      label=None, nr=None, by_label=None): # deprecated
+                      nr=None, by_label=None, label=None): # deprecated
         """Toggle selected state of list item in control having only one item.
 
         The rest is as for HTMLForm.set_single.__doc__.
@@ -2798,7 +2798,7 @@
 # Form-filling method applying only to FileControls.
 
     def add_file(self, file_object, content_type=None, filename=None,
-                 name=None, id=None, label=None, nr=None):
+                 name=None, id=None, nr=None, label=None):
         """Add a file to be uploaded.
 
         file_object: file-like object (with read method) from which to read
@@ -2832,8 +2832,9 @@
 #---------------------------------------------------
 # Form submission methods, applying only to clickable controls.
 
-    def click(self, name=None, type=None, id=None, label=None, nr=0, coord=(1,1),
-              request_class=urllib2.Request):
+    def click(self, name=None, type=None, id=None, nr=0, coord=(1,1),
+              request_class=urllib2.Request,
+              label=None):
         """Return request that would result from clicking on a control.
 
         The request object is a urllib2.Request instance, which you can pass to
@@ -2859,9 +2860,10 @@
                            self._request_class)
 
     def click_request_data(self,
-                           name=None, type=None, id=None, label=None, 
+                           name=None, type=None, id=None,
                            nr=0, coord=(1,1),
-                           request_class=urllib2.Request):
+                           request_class=urllib2.Request,
+                           label=None):
         """As for click method, but return a tuple (url, data, headers).
 
         You can use this data to send a request to the server.  This is useful
@@ -2891,8 +2893,9 @@
         return self._click(name, type, id, label, nr, coord, "request_data",
                            self._request_class)
 
-    def click_pairs(self, name=None, type=None, id=None, label=None,
-                    nr=0, coord=(1,1)):
+    def click_pairs(self, name=None, type=None, id=None,
+                    nr=0, coord=(1,1),
+                    label=None):
         """As for click_request_data, but returns a list of (key, value) pairs.
 
         You can use this list as an argument to ClientForm.urlencode.  This is
@@ -2918,8 +2921,9 @@
 #---------------------------------------------------
 
     def find_control(self,
-                     name=None, type=None, kind=None, id=None, label=None,
-                     predicate=None, nr=None):
+                     name=None, type=None, kind=None, id=None,
+                     predicate=None, nr=None,
+                     label=None):
         """Locate and return some specific control within the form.
 
         At least one of the name, type, kind, predicate and nr arguments must


More information about the wwwsearch-commits mailing list