ANN: ClientForm 0.1.7b released

John J. Lee jjl@pobox.com
13 Aug 2003 01:14:11 +0100


http://wwwsearch.sourceforge.net/ClientForm/

First (and last, I hope) beta release of 0.1.x.

Changes from 0.1.5a to 0.1.7b:
 * After some thought about Law of Demeter, realised that there was no
   justification for deprecating most use of find_control, nor for adding
   many of the new methods on HTMLForm.  Use of find_control is now
   officially OK again.  set_/get_readonly, set_/get_disabled,
   set_/get_item_disabled, set_all_items_disabled have been removed from
   HTMLForm.
 * Added HTMLForm.set_all_readonly method.  This one is actually useful!
 * possible_label_items is gone, replaced by by_label argument to
   possible_items.  by_label is now as consistent as possible.  The
   exceptions are set_value_by_label and get_value_by_label, since there
   is no method to add an argument to in those cases.  The lack of
   implementation of by_label for CHECKBOX and RADIO is considered a bug,
   so NotImplementedError is raised.  LabelNotSupportedError has gone.
 * Added indication to ListControl.__str__ of disabled items --
   they have parentheses around them: item 1, (item 2), item 3
   means "item 2" is disabled.
 * Bug fixes.


Requires Python >= 1.5.2.

ClientForm is a Python module for handling HTML forms on the client
side, useful for parsing HTML forms, filling them in and returning the
completed forms to the server.  It has developed from a port of Gisle
Aas' Perl module HTML::Form, from the libwww-perl library, but the
interface is not the same.

Simple example:

 from urllib2 import urlopen
 from ClientForm import ParseResponse

 forms = ParseResponse(urlopen("http://www.acme.com/form.html"))
 form = forms[0]
 print form
 form["author"] = "Gisle Aas"

 # form.click returns a urllib2.Request object
 # (see HTMLForm.click_request_data.__doc__ if you're not using urllib2)
 response = urlopen(form.click("Thanks"))


John