[wwwsearch-commits] r17803 - wwwsearch/ClientForm/trunk
jjlee at codespeak.net
jjlee at codespeak.net
Sat Sep 24 01:25:01 CEST 2005
Author: jjlee
Date: Sat Sep 24 01:24:59 2005
New Revision: 17803
Added:
wwwsearch/ClientForm/trunk/COPYRIGHT
Modified:
wwwsearch/ClientForm/trunk/COPYING
wwwsearch/ClientForm/trunk/ClientForm.py
wwwsearch/ClientForm/trunk/README.html.in
wwwsearch/ClientForm/trunk/test.py
Log:
Doc updates, including dual-licensing -- added ZPL as an explicitly-allowed license to make life easier for Zope users (BSD license implicitly allows redistribution under that license already, I think)
Modified: wwwsearch/ClientForm/trunk/COPYING
==============================================================================
--- wwwsearch/ClientForm/trunk/COPYING (original)
+++ wwwsearch/ClientForm/trunk/COPYING Sat Sep 24 01:24:59 2005
@@ -1,6 +1,13 @@
-Copyright (c) 2002-2004 John J. Lee <jjl at pobox.com>
+Copyright (c) 2002-2005 John J. Lee <jjl at pobox.com>
Copyright (c) 1998-2000 Gisle Aas
+This software is dual-licensed: you may pick either of the licenses
+below.
+
+
+BSD-style license
+==================
+
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -29,3 +36,27 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+ZPL 2.1
+==================
+
+Zope Public License (ZPL) Version 2.1
+
+A copyright notice accompanies this license document that identifies the copyright holders.
+
+This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders.
+ 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders.
+ 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+Disclaimer
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Added: wwwsearch/ClientForm/trunk/COPYRIGHT
==============================================================================
--- (empty file)
+++ wwwsearch/ClientForm/trunk/COPYRIGHT Sat Sep 24 01:24:59 2005
@@ -0,0 +1,4 @@
+Copyright 2002-2005 John J. Lee <jjl at pobox.com>
+Copyright 2005 Gary Poster
+Copyright 2005 Zope Corporation
+Copyright 1998-2000 Gisle Aas.
Modified: wwwsearch/ClientForm/trunk/ClientForm.py
==============================================================================
--- wwwsearch/ClientForm/trunk/ClientForm.py (original)
+++ wwwsearch/ClientForm/trunk/ClientForm.py Sat Sep 24 01:24:59 2005
@@ -16,6 +16,8 @@
Copyright 2002-2005 John J. Lee <jjl at pobox.com>
+Copyright 2005 Gary Poster
+Copyright 2005 Zope Corporation
Copyright 1998-2000 Gisle Aas.
This code is free software; you can redistribute it and/or modify it
@@ -25,6 +27,11 @@
"""
# XXXX
+# Turn ignore_ambiguity into general backwards-compat option?
+# -ignore ambiguity
+# -label matching is strict
+# -turning off individual items allowed even if disabled
+# Check old test suite passes!
# _find_control &c. and ambiguous control labels
# XXX
Modified: wwwsearch/ClientForm/trunk/README.html.in
==============================================================================
--- wwwsearch/ClientForm/trunk/README.html.in (original)
+++ wwwsearch/ClientForm/trunk/README.html.in Sat Sep 24 01:24:59 2005
@@ -87,6 +87,17 @@
</em>
+<a name="credits"></a>
+<h2>Credits</h2>
+
+<p>Apart from Gisle Aas for allowing the original port from
+libwww-perl, particular credit is due to Gary Poster and Benji York,
+and their employer, Zope Corporation, for their contributions which
+led to ClientForm 0.2 being released. Thanks also to the many people
+who have contributed bug reports.
+
+
+
<a name="download"></a>
<h2>Download</h2>
@@ -166,22 +177,22 @@
upgrade to the version from Python 2.1 (available from <a
href="http://www.python.org/">www.python.org</a>). Otherwise, you're OK.
<li>Which license?
- <p>The <a href="http://www.opensource.org/licenses/bsd-license.php"> BSD
- license</a> (included in distribution).
-
+ <p>ClientForm is dual-licensed: you may pick either the
+ <a href="http://www.opensource.org/licenses/bsd-license.php">BSD license</a>,
+ or the <a href="http://www.zope.org/Resources/ZPL">ZPL 2.1</a> (both are
+ included in the distribution).
<li>Is XHTML supported?
- <p>Yes, since 0.1.12.
+ <p>Yes. You must pass
+ <code>form_parser_class=ClientForm.XHTMLCompatibleFormParser</code> to
+ <code>ParseResponse()</code> / <code>ParseFile()</code>.
<li>How do I figure out what control names and values to use?
<p><code>print form</code> is usually all you need.
- <code>HTMLForm.possible_items</code> can be useful. Note that it's
- possible to use item labels instead of item names, which can be useful
- — use the <code>by_label</code> arguments to the various methods,
- and the <code>.get_value_by_label()</code> /
+ In your code, things like the <code>HTMLForm.items</code> attribute of
+ <code>HTMLForm</code> instances can be useful to inspect forms at
+ runtime. Note that it's possible to use item labels instead of item
+ names, which can be useful — use the <code>by_label</code>
+ arguments to the various methods, and the <code>.get_value_by_label()</code> /
<code>.set_value_by_label()</code> methods on <code>ListControl</code>.
- Only <code>SelectControl</code> currently supports item labels (which
- default to <code>OPTION</code> element contents). I might not bother to
- fix this, since it seems it's probably only useful for <code>SELECT</code>
- anyway.
<li>What do those <code>'*'</code> characters mean in the string
representations of list controls?
<p>A <code>*</code> next to an item means that item is selected.
@@ -236,7 +247,7 @@
<p>@{colorize(r"""
import bisect
def closest_int_value(form, ctrl_name, value):
- values = map(int, form.possible_items(ctrl_name))
+ values = map(int, [item.name for item in form.find_control(ctrl_name).items])
return str(values[bisect.bisect(values, value) - 1])
form["distance"] = [closest_int_value(form, "distance", 23)]
@@ -274,6 +285,7 @@
<br>
+<a href="./#download">Credits</a><br>
<a href="./#download">Download</a><br>
<a href="./#faq">FAQs</a><br>
Modified: wwwsearch/ClientForm/trunk/test.py
==============================================================================
--- wwwsearch/ClientForm/trunk/test.py (original)
+++ wwwsearch/ClientForm/trunk/test.py Sat Sep 24 01:24:59 2005
@@ -1,6 +1,11 @@
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
+# Copyright 2002-2005 John J. Lee <jjl at pobox.com>
+# Copyright 2005 Gary Poster
+# Copyright 2005 Zope Corporation
+# Copyright 1998-2000 Gisle Aas.
+
import unittest, string
from unittest import TestCase
from cStringIO import StringIO
More information about the wwwsearch-commits
mailing list