>>>>> "Neil" == Neil McGovern <neilm@debian.org> writes: Neil> Could you attach the diff please? Sure. Thanks a lot. Cheers, Arnaud Fontaine
diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/changelog twill-0.9/debian/changelog --- twill-0.9~b1/debian/changelog 2009-01-22 22:39:25.000000000 +0000 +++ twill-0.9/debian/changelog 2009-01-22 22:39:08.000000000 +0000 @@ -1,3 +1,26 @@ +twill (0.9-1) unstable; urgency=low + + [ Arnaud Fontaine ] + * New upstream bugfix release. + * debian/control: + + Add ${misc:Depends} to Depends in case the result of a call to + debhelper tools adds extra dependencies. + + Drop useless Build-Depends on patchutils. + + Bump Standards-Version to 3.8.0. + - Add debian/README.source. + * debian/doc-base: + + Change the section to Programming. + * debian/copyright: + + Update copyright years. + + Reorganize to make copyright information clearer. + + [ Sandro Tosi ] + * debian/control: + - Uniforming Vcs-Browser field. + - Switch Vcs-Browser field to viewsvn. + + -- Arnaud Fontaine <arnau@debian.org> Wed, 21 Jan 2009 23:54:29 +0000 + twill (0.9~b1-2) unstable; urgency=low [ Arnaud Fontaine ] diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/control twill-0.9/debian/control --- twill-0.9~b1/debian/control 2009-01-22 22:39:25.000000000 +0000 +++ twill-0.9/debian/control 2009-01-22 22:39:08.000000000 +0000 @@ -4,28 +4,28 @@ Maintainer: Arnaud Fontaine <arnau@debian.org> Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Build-Depends: debhelper (>= 5.0.37.2), - cdbs (>= 0.4.43), + cdbs (>= 0.4.49), python-dev (>= 2.3.5-11), - python-support (>= 0.3.2), - patchutils (>= 0.2.25), + python-support (>= 0.7.1), quilt Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml, -Standards-Version: 3.7.3 +Standards-Version: 3.8.0 Homepage: http://twill.idyll.org/ Vcs-Svn: svn://svn.debian.org/python-modules/packages/twill/trunk/ -Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/twill/?op=log +Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/twill/trunk/ Package: python-twill Architecture: all Depends: ${python:Depends}, + ${misc:Depends}, python-mechanize (>= 0.1.7b-2), python-clientform (>= 0.2.6), python-pyparsing (>= 1.4.1) Recommends: doc-base Description: A simple scripting language for Web browsing Twill is a simple scripting language intended for programmatic or - automated browsing of Web sites. It allows allows users to browse the - Web from a command-line interface. So, you can navigate through Web - sites that use forms, cookies, and most standard Web features. + automated browsing of Web sites. It allows users to browse the Web + from a command-line interface. So, you can navigate through Web sites + that use forms, cookies, and most standard Web features. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/copyright twill-0.9/debian/copyright --- twill-0.9~b1/debian/copyright 2009-01-22 22:39:25.000000000 +0000 +++ twill-0.9/debian/copyright 2009-01-22 22:39:08.000000000 +0000 @@ -5,7 +5,7 @@ Author: C. Titus Brown <titus@caltech.edu> -Copyright (c) 2005-2007 C. Titus Brown <titus@caltech.edu> +Copyright (c) 2005-2009 C. Titus Brown <titus@caltech.edu> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -30,12 +30,154 @@ In addition of twill main code, the following module are distributed along with twill under the following licenses: -* twill/other_packages/mechanize/_beautifulsoup.py: +Files: twill/other_packages/_mechanize_dist/_useragent.py + twill/other_packages/_mechanize_dist/_opener.py + twill/other_packages/_mechanize_dist/_util.py + twill/other_packages/_mechanize_dist/_rfc3986.py + twill/other_packages/_mechanize_dist/_request.py + twill/other_packages/_mechanize_dist/_auth.py + twill/other_packages/_mechanize_dist/_response.py + twill/other_packages/_mechanize_dist/_html.py + twill/other_packages/_mechanize_dist/_http.py + Copyright 2002-2009 John J. Lee <jjl@pobox.com> + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. + + ZPL 2.1 license + --------------- + + 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 + LI ABLE 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, WHET HER 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. + + +File: twill/other_packages/_mechanize_dist/_clientcookie.py + + Copyright 2002-2009 John J Lee <jjl@pobox.com> + Copyright 1997-2009 Gisle Aas (original libwww-perl code) + Copyright 2002-2009 Johnny Lee (original MSIE Perl code) + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. + + +Files: twill/other_packages/_mechanize_dist/_pullparser.py + twill/other_packages/_mechanize_dist/_lwpcookiejar.py + twill/other_packages/_mechanize_dist/_headersutil.py + twill/other_packages/_mechanize_dist/_mozillacookiejar.py + Copyright 2003-2009 John J. Lee <jjl@pobox.com> + Copyright 1997-2009 Gisle Aas (original libwww-perl code) + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. + + +File: twill/other_packages/_mechanize_dist/_mechanize.py + Copyright 2003-2009 John J. Lee <jjl@pobox.com> + Copyright 2003-2009 Andy Lester (original Perl code) + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. - Copyright: Copyright (c) 2004 Leonard Richardson - License: Available under the same terms as Python. The Python - license is reproduced below. +File: twill/other_packages/_mechanize_dist/_msiecookiejar.py + Copyright 2002-2009 Johnny Lee <typo_pl@hotmail.com> (MSIE Perl code) + Copyright 2002-2009 John J Lee <jjl@pobox.com> (The Python port) + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. + + +File: twill/other_packages/ClientForm.py + Copyright 2002-2009 John J. Lee <jjl@pobox.com> + Copyright 2005-2009 Gary Poster + Copyright 2005-2009 Zope Corporation + Copyright 1998-2009 Gisle Aas. + License: + + This code is free software; you can redistribute it and/or modify it + under the terms of the BSD or ZPL 2.1 licenses. + + On Debian systems, the complete text of the BSD License can be found + in `/usr/share/common-licenses/BSD. The complete text of ZPL 2.1 + license is available above. + + +File: twill/other_packages/_mechanize_dist/_beautifulsoup.py + Copyright (c) 2004-2009 Leonard Richardson + License: PSF LICENSE AGREEMENT FOR PYTHON 2.3 ------------------------------------ @@ -88,9 +230,10 @@ agrees to be bound by the terms and conditions of this License Agreement. -twill/other_packages/pyparsing.py: - Copyright (c) 2003-2006 Paul T. McGuire +File: twill/other_packages/pyparsing.py + Copyright (c) 2003-2009 Paul T. McGuire + License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -112,55 +255,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -twill/other_packages/mechanize: - - Copyright (c) 2002-2004 John J. Lee <jjl@pobox.com> - Copyright (c) 2003 Andy Lester - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of the contributors nor the names of their - employers may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS 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 OWNER OR CONTRIBUTORS 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. - -twill/other_packages/ClientForm.py: - - Copyright 2002-2006 John J. Lee <jjl@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 - under the terms of the BSD or ZPL 2.1 licenses. - -twill/other_packages/subprocess.py: - Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> +File: twill/other_packages/subprocess.py + Copyright (c) 2003-2009 by Peter Astrand <astrand@lysator.liu.se> + License: PSF LICENSE AGREEMENT FOR PYTHON 2.4 ------------------------------------ @@ -213,7 +311,7 @@ agrees to be bound by the terms and conditions of this License Agreement. -The Debian packaging is (C) 2007, Arnaud Fontaine <arnau@debian.org> -and is licensed under the GPL. On Debian systems, the complete text of -the GNU General Public License can be found in -`/usr/share/common-licenses/GPL'. +The Debian packaging is (C) 2007-2009, Arnaud Fontaine +<arnau@debian.org> and is licensed under the GPL (version 2 or later). +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL*'. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/doc-base twill-0.9/debian/doc-base --- twill-0.9~b1/debian/doc-base 2009-01-22 22:39:25.000000000 +0000 +++ twill-0.9/debian/doc-base 2009-01-22 22:39:08.000000000 +0000 @@ -3,9 +3,8 @@ Author: C. Titus Brown <titus@idyll.org> Abstract: This documentation describes what is twill and how to use it for programming purpose. -Section: Apps/Programming +Section: Programming Format: HTML Index: /usr/share/doc/python-twill/html/index.html Files: /usr/share/doc/python-twill/html/*.html - diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/patches/02_remove_ext.patch twill-0.9/debian/patches/02_remove_ext.patch --- twill-0.9~b1/debian/patches/02_remove_ext.patch 2009-01-22 22:39:25.000000000 +0000 +++ twill-0.9/debian/patches/02_remove_ext.patch 2009-01-22 22:39:08.000000000 +0000 @@ -1,12 +1,88 @@ ---- twill-0.9~b1.orig/setup.py -+++ twill-0.9~b1/setup.py +Index: twill-0.9/setup.py +=================================================================== +--- twill-0.9.orig/setup.py 2007-12-28 06:45:16.000000000 +0000 ++++ twill-0.9/setup.py 2009-01-19 01:00:23.000000000 +0000 @@ -18,8 +18,7 @@ author_email = 'titus@idyll.org', license='MIT', - packages = ['twill', 'twill.other_packages', -- 'twill.other_packages.mechanize', +- 'twill.other_packages._mechanize_dist', + packages = ['twill', 'twill.extensions', 'twill.extensions.match_parse'], +Index: twill-0.9/twill/_browser.py +=================================================================== +--- twill-0.9.orig/twill/_browser.py 2007-12-28 06:45:16.000000000 +0000 ++++ twill-0.9/twill/_browser.py 2009-01-19 01:01:30.000000000 +0000 +@@ -3,13 +3,13 @@ + """ + + # wwwsearch imports +-from _mechanize_dist import Browser as MechanizeBrowser ++from mechanize import Browser as MechanizeBrowser + + import wsgi_intercept + from utils import FixedHTTPBasicAuthHandler, FunctioningHTTPRefreshProcessor + + def build_http_handler(): +- from _mechanize_dist._urllib2 import HTTPHandler ++ from mechanize._urllib2 import HTTPHandler + + class MyHTTPHandler(HTTPHandler): + def http_open(self, req): +Index: twill-0.9/twill/browser.py +=================================================================== +--- twill-0.9.orig/twill/browser.py 2007-12-28 06:45:16.000000000 +0000 ++++ twill-0.9/twill/browser.py 2009-01-19 01:00:23.000000000 +0000 +@@ -10,8 +10,9 @@ + import re + + # wwwsearch imports +-import _mechanize_dist as mechanize +-from _mechanize_dist import BrowserStateError, LinkNotFoundError, ClientForm ++import mechanize ++import ClientForm ++from mechanize import BrowserStateError, LinkNotFoundError + + # twill package imports + from _browser import PatchedMechanizeBrowser +Index: twill-0.9/twill/commands.py +=================================================================== +--- twill-0.9.orig/twill/commands.py 2007-12-28 06:45:16.000000000 +0000 ++++ twill-0.9/twill/commands.py 2009-01-19 01:00:23.000000000 +0000 +@@ -4,9 +4,9 @@ + """ + + import sys +-import _mechanize_dist as mechanize +-from _mechanize_dist import ClientForm +-from _mechanize_dist._headersutil import is_html ++import mechanize ++import ClientForm ++from mechanize._headersutil import is_html + + OUT=None + ERR=sys.stderr +Index: twill-0.9/twill/utils.py +=================================================================== +--- twill-0.9.orig/twill/utils.py 2007-12-28 06:45:16.000000000 +0000 ++++ twill-0.9/twill/utils.py 2009-01-19 01:00:23.000000000 +0000 +@@ -11,11 +11,11 @@ + + import subprocess + +-import _mechanize_dist as mechanize +-from _mechanize_dist import ClientForm +-from _mechanize_dist._util import time +-from _mechanize_dist._http import HTTPRefreshProcessor +-from _mechanize_dist import BrowserStateError ++import mechanize ++import ClientForm ++from mechanize._util import time ++from mechanize._http import HTTPRefreshProcessor ++from mechanize import BrowserStateError + + class ResultWrapper: + """ diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/debian/README.source twill-0.9/debian/README.source --- twill-0.9~b1/debian/README.source 1970-01-01 01:00:00.000000000 +0100 +++ twill-0.9/debian/README.source 2009-01-22 22:39:08.000000000 +0000 @@ -0,0 +1,6 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +'debian/patches' and applied during the build. + +You can find explanations about quilt usage in the following file: +/usr/share/doc/quilt/README.source diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/ANNOUNCE-0.9.txt twill-0.9/doc/ANNOUNCE-0.9.txt --- twill-0.9~b1/doc/ANNOUNCE-0.9.txt 1970-01-01 01:00:00.000000000 +0100 +++ twill-0.9/doc/ANNOUNCE-0.9.txt 2007-12-28 06:45:16.000000000 +0000 @@ -0,0 +1,59 @@ +ANNOUNCING twill v0.9. + +twill is a simple language for browsing the Web. It's designed for +automated testing of Web sites, but it can be used to interact with +Web sites in a variety of ways. In particular, twill supports form +submission, cookies, redirects, and HTTP authentication. + +This release of twill is officially "Pretty Dang Stable". + +A twill script to use the "I'm feeling lucky" button on Google looks +like this: + + setlocal query "twill Python" + + go http://www.google.com/ + + fv 1 q $query + submit btnI # use the "I'm feeling lucky" button + + show + +(Note that using this script abuses Google's Terms of Service. So don't.) + +You can install the latest release of twill with easy_install, + + easy_install twill + +or download this release at + + http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz + +Documentation is included in the .tar.gz and is also online at + + http://twill.idyll.org/ + +Miscellaneous details: + +twill is implemented in Python and uses pyparsing and mechanize. In +addition to the existing simple command language, twill can easily be +extended with Python. twill also provides a fairly simple and +well-documented wrapper around mechanize. + +Note that twill does not understand JavaScript. + +--- + +Significant changes with 0.9: + + - many small bugs were fixed, of course! + + - patched subprocess pipe problem (Chris Abraham). This fixes problems + with long-running twill processes. + + - twill now "plays nice" with other versions of mechanize and ClientForm + (good for including it in distributions). + + - Corrected license information => MIT in all files. + + - new 'info' command gives human-readable page summary. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/ChangeLog twill-0.9/doc/ChangeLog --- twill-0.9~b1/doc/ChangeLog 2007-03-06 23:00:03.000000000 +0000 +++ twill-0.9/doc/ChangeLog 2007-12-28 06:45:16.000000000 +0000 @@ -1,3 +1,65 @@ +2007-12-27 Titus Brown <t@iorich.caltech.edu> + + * Added better error message to 'url' (Matt Wilson). + +2007-12-23 Titus Brown <t@iorich.caltech.edu> + + * Updated version to 0.9. + + * Updated license information => MIT in all files, along + with Web link and copyright (Will Maier) + + * Updated tests to work with nose > 0.9.x. + +2007-12-04 Titus Brown <t@iorich.caltech.edu> + + * Fixed iterator double call in wsgi_intercept (Antti Kaihola). + +2007-07-02 C. Titus Brown <t@chreotha> + + * Fixed small documentation error in commands (Bill Mill). + + * Fixed another problem match_parse: made popmatch work properly + (Sheryl). + +2007-07-01 C. Titus Brown <t@chreotha> + + * Moved 'mechanize' to '_mechanize_dist', 'ClientForm' to + '_mechanize_dist.ClientForm', as requested for Debian dists. + + * Fixed a problem with __matchlist__ in match_parse extension + (Sheryl). + + * All raised exceptions now inherit from TwillException (Kevin Turner). + + * Eliminated FakeResponse and switched to using + mechanize.make_response (Jacob Hallan, JJL). + + * Updated mechanize to latest; includes my two patches to mechanize. + +2007-06-04 Titus Brown <t@iorich.caltech.edu> + + * Updated mechanize to latest. + + * Patched subprocess pipe freeing problem (Chris Abraham). (This + is a moderately serious bug for long-running programs that use + subprocess to try to run programs that don't exist.) + + My patch modifies run_tidy to remember if subprocess failed because + tidy didn't exist. + +2007-05-28 Titus Brown <t@iorich.caltech.edu> + + * Added 'info' command, docs, and tests. + + * Removed gopherlib references in mechanize; added test. + +2007-03-19 Titus Brown <t@localhost.localdomain> + + * Fixed bug in my patch to mechanize 'select_form'. + + * Removed debug 'print' in wsgi_intercept.py. + 2007-03-06 Titus Brown <t@localhost.localdomain> * RELEASE 0.9b1. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/commands.html twill-0.9/doc/commands.html --- twill-0.9~b1/doc/commands.html 2007-03-06 23:00:03.000000000 +0000 +++ twill-0.9/doc/commands.html 2007-12-28 06:45:16.000000000 +0000 @@ -319,6 +319,7 @@ <div class="section"> <h1><a id="display" name="display">Display</a></h1> <p><strong>echo</strong> <em><string></em> -- echo the string to the screen.</p> +<p><strong>info</strong> -- display information about the current page.</p> <p><strong>redirect_output</strong> <em><filename></em> -- append all twill output to the given file.</p> <p><strong>reset_output</strong> -- display all output to the screen.</p> <p><strong>save_html</strong> <em>[<filename>]</em> -- save the current page's HTML into a file. If @@ -362,7 +363,7 @@ <dt><strong>debug</strong> <em><what></em> <em><level></em> -- turn on or off debugging/tracing for</dt> <dd>various functions. The first argument is either 'http' to show HTTP headers, 'equiv-refresh' to test HTTP EQUIV-REFRESH headers, or -'twill' to show twill commands. The second argument is '0' for off, +'commands' to show twill commands. The second argument is '0' for off, '1' for on.</dd> </dl> </div> diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/commands.txt twill-0.9/doc/commands.txt --- twill-0.9~b1/doc/commands.txt 2007-03-06 23:00:03.000000000 +0000 +++ twill-0.9/doc/commands.txt 2007-12-28 06:45:16.000000000 +0000 @@ -42,6 +42,8 @@ **echo** *<string>* -- echo the string to the screen. +**info** -- display information about the current page. + **redirect_output** *<filename>* -- append all twill output to the given file. **reset_output** -- display all output to the screen. @@ -103,7 +105,7 @@ **debug** *<what>* *<level>* -- turn on or off debugging/tracing for various functions. The first argument is either 'http' to show HTTP headers, 'equiv-refresh' to test HTTP EQUIV-REFRESH headers, or - 'twill' to show twill commands. The second argument is '0' for off, + 'commands' to show twill commands. The second argument is '0' for off, '1' for on. Variable handling diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/developer.html twill-0.9/doc/developer.html --- twill-0.9~b1/doc/developer.html 2007-03-06 23:00:04.000000000 +0000 +++ twill-0.9/doc/developer.html 2007-12-28 06:45:16.000000000 +0000 @@ -302,9 +302,9 @@ </div> <div class="section"> <h1><a id="licensing" name="licensing">Licensing</a></h1> -<p>twill 0.8 is licensed under the <a class="reference" href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. All code currently -contained in twill is Copyright (C) 2005, 2006, 2007 C. Titus Brown -<<a class="reference" href="mailto:titus@idyll.org">titus@idyll.org</a>>.</p> +<p>twill 0.8 and above are licensed under the <a class="reference" href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. All code +currently contained in twill is Copyright (C) 2005, 2006, 2007 +C. Titus Brown <<a class="reference" href="mailto:titus@idyll.org">titus@idyll.org</a>>.</p> <p>In plain English: I own the code, but you're welcome to use it, subsume it into other projects, and distribute it freely. However, you must retain copyright attribution.</p> @@ -314,10 +314,10 @@ <div class="section"> <h1><a id="developer-releases" name="developer-releases">Developer releases</a></h1> <p>"Developer releases" incorporating all recent significant changes are -made available in egg format at <a class="reference" href="http://issola.caltech.edu/~t/dist/">http://issola.caltech.edu/~t/dist/</a>.</p> +made available at <a class="reference" href="http://darcs.idyll.org/~t/projects/twill-latest.tar.gz">http://darcs.idyll.org/~t/projects/twill-latest.tar.gz</a></p> <p>You can install them with easy_install by typing</p> <pre class="literal-block"> -easy_install -f http://issola.caltech.edu/~t/dist/ twill +easy_install -f http://darcs.idyll.org/~t/projects/twill-latest.tar.gz </pre> </div> <div class="section"> diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/developer.txt twill-0.9/doc/developer.txt --- twill-0.9~b1/doc/developer.txt 2007-03-06 23:00:04.000000000 +0000 +++ twill-0.9/doc/developer.txt 2007-12-28 06:45:16.000000000 +0000 @@ -18,9 +18,9 @@ Licensing ~~~~~~~~~ -twill 0.8 is licensed under the `MIT license`_. All code currently -contained in twill is Copyright (C) 2005, 2006, 2007 C. Titus Brown -<titus@idyll.org>. +twill 0.8 and above are licensed under the `MIT license`_. All code +currently contained in twill is Copyright (C) 2005, 2006, 2007 +C. Titus Brown <titus@idyll.org>. In plain English: I own the code, but you're welcome to use it, subsume it into other projects, and distribute it freely. However, @@ -29,18 +29,17 @@ pyparsing_, BeautifulSoup_, and mechanize_ are all included with twill, but are under their own licenses. -.. _twill-latest.tar.gz: http://darcs.idyll.org/~t/projects/twill-latest.tar.gz .. _MIT license: http://www.opensource.org/licenses/mit-license.php Developer releases ~~~~~~~~~~~~~~~~~~ "Developer releases" incorporating all recent significant changes are -made available in egg format at http://issola.caltech.edu/~t/dist/. +made available at http://darcs.idyll.org/~t/projects/twill-latest.tar.gz You can install them with easy_install by typing :: - easy_install -f http://issola.caltech.edu/~t/dist/ twill + easy_install -f http://darcs.idyll.org/~t/projects/twill-latest.tar.gz Obtaining twill with darcs ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/index.html twill-0.9/doc/index.html --- twill-0.9~b1/doc/index.html 2007-03-06 23:00:04.000000000 +0000 +++ twill-0.9/doc/index.html 2007-12-28 06:45:16.000000000 +0000 @@ -300,10 +300,10 @@ <p>twill is open source and written in Python.</p> <div class="section"> <h1><a id="downloading-twill" name="downloading-twill">Downloading twill</a></h1> -<p>The latest release of twill is <a class="reference" href="ANNOUNCE-0.9b1.txt">twill 0.9b1</a>, released Tuesday, March 6th, -2007; it is available for download at -<a class="reference" href="http://darcs.idyll.org/~t/projects/twill-0.9b1.tar.gz">http://darcs.idyll.org/~t/projects/twill-0.9b1.tar.gz</a>. You can also -use Python's <a class="reference" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a> to install or upgrade twill.</p> +<p>The latest release of twill is <a class="reference" href="ANNOUNCE-0.9.txt">twill 0.9</a>, +released Thursday, December 27th, 2007; it is available for download at +<a class="reference" href="http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz">http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz</a>. You can also use +Python's <a class="reference" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a> to install or upgrade twill.</p> <p>twill works with Python 2.3 or later.</p> <p>To start using twill, install it and then type <tt class="docutils literal"><span class="pre">twill-sh</span></tt>. At the prompt type:</p> @@ -320,8 +320,6 @@ <a class="reference" href="http://twill.idyll.org/">http://twill.idyll.org/</a>.</p> <p>The in-development version of the docs can be found at <a class="reference" href="http://darcs.idyll.org/~t/projects/twill/doc/">http://darcs.idyll.org/~t/projects/twill/doc/</a>.</p> -<p>The development Web site, with a Trac tracker and wiki, is at -<a class="reference" href="http://twill.idyll.org/trac/">http://twill.idyll.org/trac/</a>.</p> <p>Documentation is available for the following topics:</p> <blockquote> <ul class="simple"> diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/index.txt twill-0.9/doc/index.txt --- twill-0.9~b1/doc/index.txt 2007-03-06 23:00:04.000000000 +0000 +++ twill-0.9/doc/index.txt 2007-12-28 06:45:16.000000000 +0000 @@ -14,10 +14,10 @@ Downloading twill ----------------- -The latest release of twill is `twill 0.9b1`_, released Tuesday, March 6th, -2007; it is available for download at -http://darcs.idyll.org/~t/projects/twill-0.9b1.tar.gz. You can also -use Python's easy_install_ to install or upgrade twill. +The latest release of twill is `twill 0.9 <ANNOUNCE-0.9.txt>`__, +released Thursday, December 27th, 2007; it is available for download at +http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz. You can also use +Python's easy_install_ to install or upgrade twill. twill works with Python 2.3 or later. @@ -38,9 +38,6 @@ The in-development version of the docs can be found at http://darcs.idyll.org/~t/projects/twill/doc/. -The development Web site, with a Trac tracker and wiki, is at -http://twill.idyll.org/trac/. - Documentation is available for the following topics: * `Examples`_ -- some short examples. @@ -133,7 +130,6 @@ .. _archive: http://lists.idyll.org/pipermail/twill/ .. _cmd: http://docs.python.org/lib/module-cmd.html -.. _twill 0.9b1: ANNOUNCE-0.9b1.txt .. _MIT license: http://www.opensource.org/licenses/mit-license.php .. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/doc/LICENSE.txt twill-0.9/doc/LICENSE.txt --- twill-0.9~b1/doc/LICENSE.txt 2007-03-06 23:00:03.000000000 +0000 +++ twill-0.9/doc/LICENSE.txt 2007-12-28 06:45:16.000000000 +0000 @@ -1,20 +1,21 @@ +The MIT License, http://www.opensource.org/licenses/mit-license.php + twill is Copyright (c) 2005, 2006, 2007 by C. Titus Brown. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/setup.py twill-0.9/setup.py --- twill-0.9~b1/setup.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/setup.py 2007-12-28 06:45:16.000000000 +0000 @@ -10,8 +10,8 @@ setup(name = 'twill', - version = '0.9b1', - download_url = 'http://darcs.idyll.org/~t/projects/twill-0.9b1.tar.gz', + version = '0.9', + download_url = 'http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz', description = 'twill Web browsing language', author = 'C. Titus Brown', @@ -19,7 +19,7 @@ license='MIT', packages = ['twill', 'twill.other_packages', - 'twill.other_packages.mechanize', + 'twill.other_packages._mechanize_dist', 'twill.extensions', 'twill.extensions.match_parse'], diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/_browser.py twill-0.9/twill/_browser.py --- twill-0.9~b1/twill/_browser.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/_browser.py 2007-12-28 06:45:16.000000000 +0000 @@ -3,16 +3,13 @@ """ # wwwsearch imports -import mechanize -from mechanize import Browser as MechanizeBrowser -from mechanize import BrowserStateError, LinkNotFoundError +from _mechanize_dist import Browser as MechanizeBrowser import wsgi_intercept -from utils import run_tidy, StringIO, \ - FixedHTTPBasicAuthHandler, FunctioningHTTPRefreshProcessor +from utils import FixedHTTPBasicAuthHandler, FunctioningHTTPRefreshProcessor def build_http_handler(): - from mechanize._urllib2 import HTTPHandler + from _mechanize_dist._urllib2 import HTTPHandler class MyHTTPHandler(HTTPHandler): def http_open(self, req): diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/browser.py twill-0.9/twill/browser.py --- twill-0.9~b1/twill/browser.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/browser.py 2007-12-28 06:45:16.000000000 +0000 @@ -8,16 +8,16 @@ # Python imports import re -import urlparse # wwwsearch imports -import mechanize, ClientForm -from mechanize import BrowserStateError, LinkNotFoundError +import _mechanize_dist as mechanize +from _mechanize_dist import BrowserStateError, LinkNotFoundError, ClientForm # twill package imports from _browser import PatchedMechanizeBrowser -from utils import trunc, print_form, ConfigurableParsingFactory, \ +from utils import print_form, ConfigurableParsingFactory, \ ResultWrapper, unique_match, HistoryStack +from errors import TwillException # @@ -113,8 +113,7 @@ self._journey('open', u) success = True break - except IOError: - raise + except IOError: # @CTB test this! pass if success: @@ -363,9 +362,9 @@ # error out? if found is None: if not found_multiple: - raise Exception('no field matches "%s"' % (fieldname,)) + raise TwillException('no field matches "%s"' % (fieldname,)) else: - raise Exception('multiple matches to "%s"' % (fieldname,)) + raise TwillException('multiple matches to "%s"' % (fieldname,)) return found @@ -384,6 +383,8 @@ return False self._browser.select_form(predicate=choose_this_form) + assert self._browser.form == form + self.last_submit_button = None # record the last submit button clicked. @@ -398,7 +399,7 @@ fieldname = str(fieldname) if not self.get_all_forms(): - raise Exception("no forms on this page!") + raise TwillException("no forms on this page!") ctl = None @@ -408,7 +409,9 @@ if len(forms) == 1: form = forms[0] else: - raise Exception("more than one form; you must select one (use 'fv') before submitting") + raise TwillException("""\ +more than one form; you must select one (use 'fv') before submitting\ +""") # no fieldname? see if we can use the last submit button clicked... if not fieldname: @@ -433,8 +436,9 @@ if ctl: # submit w/button - print>>OUT, 'Note: submit is using submit button: name="%s", value="%s"' % \ - (ctl.name, ctl.value) + print>>OUT, """\ +Note: submit is using submit button: name="%s", value="%s" +""" % (ctl.name, ctl.value) if isinstance(ctl, ClientForm.ImageControl): request = ctl._click(form, (1,1), "", mechanize.Request) @@ -484,7 +488,10 @@ """ Pretty-print all of the cookies. """ - print>>OUT, '\nThere are %d cookie(s) in the cookiejar.\n' % (len(self.cj,)) + print>>OUT, ''' +There are %d cookie(s) in the cookiejar. +''' % (len(self.cj,)) + if len(self.cj): for cookie in self.cj: print>>OUT, '\t', cookie @@ -528,7 +535,9 @@ ## special case refresh loops!? if code == 'refresh': - raise Exception("infinite refresh loop discovered; aborting.\nTry turning off acknowledge_equiv_refresh...") + raise TwillException("""\ +infinite refresh loop discovered; aborting. +Try turning off acknowledge_equiv_refresh...""") self.result = ResultWrapper(code, r.geturl(), r.read()) diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/commands.py twill-0.9/twill/commands.py --- twill-0.9~b1/twill/commands.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/commands.py 2007-12-28 06:45:16.000000000 +0000 @@ -3,7 +3,10 @@ twill-sh. """ -import sys, mechanize +import sys +import _mechanize_dist as mechanize +from _mechanize_dist import ClientForm +from _mechanize_dist._headersutil import is_html OUT=None ERR=sys.stderr @@ -58,14 +61,15 @@ 'reset_error', 'add_extra_header', 'show_extra_headers', - 'clear_extra_headers' + 'clear_extra_headers', + 'info' ] import re, getpass, time from browser import TwillBrowser -from errors import TwillAssertionError +from errors import TwillException, TwillAssertionError import utils from utils import set_form_control_value, run_tidy from namespaces import get_twill_glocals @@ -164,9 +168,14 @@ m = None if current_url is not None: m = regexp.search(current_url) + else: + current_url = '' if not m: - raise TwillAssertionError("url does not match '%s'" % (should_be,)) + raise TwillAssertionError("""\ +current url is '%s'; +does not match '%s' +""" % (current_url, should_be,)) if m.groups(): match_str = m.group(1) @@ -234,7 +243,7 @@ else: match_str = m.group(0) - global_dict, local_dict = get_twill_glocals() + _, local_dict = get_twill_glocals() local_dict['__match__'] = match_str def notfind(what, flags=''): @@ -419,8 +428,6 @@ 'formvalue' is available as 'fv' as well. """ - import ClientForm - form = browser.get_form(formname) if not form: raise TwillAssertionError("no matching forms!") @@ -438,7 +445,7 @@ return if isinstance(control, ClientForm.FileControl): - raise Exception('form field is for file upload; use "formfile" instead') + raise TwillException('form field is for file upload; use "formfile" instead') set_form_control_value(control, value) @@ -468,7 +475,7 @@ control = browser.get_form_field(form, fieldname) if not control.is_of_kind('file'): - raise Exception('ERROR: field is not a file upload field!') + raise TwillException('ERROR: field is not a file upload field!') browser.clicked(form, control) fp = open(filename, 'rb') @@ -527,7 +534,7 @@ >> getinput <prompt> Get input, store it in '__input__'. """ - global_dict, local_dict = get_twill_glocals() + _, local_dict = get_twill_glocals() inp = raw_input(prompt) @@ -540,7 +547,7 @@ Get a password ("invisible input"), store it in '__password__'. """ - global_dict, local_dict = get_twill_glocals() + _, local_dict = get_twill_glocals() inp = getpass.getpass(prompt) @@ -644,7 +651,7 @@ else: parse.debug_print_commands(False) else: - raise Exception('unknown debugging type: "%s"' % (what,)) + raise TwillException('unknown debugging type: "%s"' % (what,)) def run(cmd): """ @@ -841,7 +848,7 @@ if v is None: print>>OUT, '*** no such configuration key', key print>>OUT, 'valid keys are:', ";".join(_options.keys()) - raise Exception('no such configuration key: %s' % (key,)) + raise TwillException('no such configuration key: %s' % (key,)) elif value is None: print>>OUT, '' print>>OUT, 'key %s: value %s' % (key, v) @@ -849,3 +856,38 @@ else: value = utils.make_boolean(value) _options[key] = value + +def info(): + """ + >> info + + Report information on current page. + """ + current_url = browser.get_url() + if current_url is None: + print "We're not on a page!" + return + + content_type = browser._browser._response.info().getheaders("content-type") + check_html = is_html(content_type, current_url) + + code = browser.get_code() + + + print >>OUT, '\nPage information:' + print >>OUT, '\tURL:', current_url + print >>OUT, '\tHTTP code:', code + print >>OUT, '\tContent type:', content_type[0], + if check_html: + print >>OUT, '(HTML)' + else: + print '' + if check_html: + title = browser.get_title() + print >>OUT, '\tPage title:', title + + forms = browser.get_all_forms() + if len(forms): + print >>OUT, '\tThis page contains %d form(s)' % (len(forms),) + + print >>OUT, '' diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/errors.py twill-0.9/twill/errors.py --- twill-0.9~b1/twill/errors.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/errors.py 2007-12-28 06:45:16.000000000 +0000 @@ -1,10 +1,16 @@ -class TwillAssertionError(Exception): +class TwillException(Exception): + """ + General twill exception. + """ + pass + +class TwillAssertionError(TwillException): """ AssertionError to raise upon failure of some twill command. """ pass -class TwillNameError(Exception): +class TwillNameError(TwillException): """ Error to raise when an unknown command is called. """ diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/extensions/match_parse/__init__.py twill-0.9/twill/extensions/match_parse/__init__.py --- twill-0.9~b1/twill/extensions/match_parse/__init__.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/extensions/match_parse/__init__.py 2007-12-28 06:45:16.000000000 +0000 @@ -86,6 +86,6 @@ """ global_dict, local_dict = get_twill_glocals() - match = local_dict['__matchlist__'] - match.pop(int(which)) + matchlist = local_dict['__matchlist__'] + match = matchlist.pop(int(which)) local_dict['__match__'] = match diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/__init__.py twill-0.9/twill/__init__.py --- twill-0.9~b1/twill/__init__.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/__init__.py 2007-12-28 06:45:16.000000000 +0000 @@ -1,20 +1,20 @@ # This file is part of the twill source distribution. # # twill is a extensible scriptlet language for testing Web apps, -# available at http://www.idyll.org/~t/www-tools/twill.html. +# available at http://twill.idyll.org/. # -# Contact author: C. Titus Brown, titus@caltech.edu. +# Contact author: C. Titus Brown, titus@idyll.org. # # This program and all associated source code files are Copyright (C) -# 2005 by C. Titus Brown. It is under the Lesser GNU Public License; +# 2005-2007 by C. Titus Brown. It is released under the MIT license; # please see the included LICENSE.txt file for more information, or -# contact Titus directly. +# go to http://www.opensource.org/licenses/mit-license.php. """ twill Web testing language & associated utilities. """ -__version__ = "0.9b1" +__version__ = "0.9" #import warnings #warnings.defaultaction = "error" @@ -57,7 +57,9 @@ def get_browser_state(): import warnings - warnings.warn("get_browser_state is deprecated; use 'twill.get_browser() instead.", DeprecationWarning) + warnings.warn("""\ +get_browser_state is deprecated; use 'twill.get_browser() instead. +""", DeprecationWarning) return get_browser() # initialize global dict diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/parse.py twill-0.9/twill/parse.py --- twill-0.9~b1/twill/parse.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/parse.py 2007-12-28 06:45:16.000000000 +0000 @@ -71,15 +71,21 @@ """ newargs = [] for arg in args: - # __variable substitution. @CTB do we need this? + # __variable substitution. if arg.startswith('__'): try: val = eval(arg, globals_dict, locals_dict) except NameError: # not in dictionary; don't interpret. val = arg - - newargs.append(val) + + print '*** VAL IS', val, 'FOR', arg + + if isinstance(val, str): + newargs.append(val) + else: + newargs.extend(val) + # $variable substitution elif arg.startswith('$') and not arg.startswith('${'): try: @@ -201,19 +207,17 @@ try: - n = 0 - for line in inp: - n += 1 - + for n, line in enumerate(inp): if not line.strip(): # skip empty lines continue + cmdinfo = "%s:%d" % (sourceinfo, n,) + print 'AT LINE:', cmdinfo + cmd, args = parse_command(line, globals_dict, locals_dict) if cmd is None: continue - cmdinfo = "%s:%d" % (sourceinfo, n,) - try: execute_command(cmd, args, globals_dict, locals_dict, cmdinfo) except SystemExit: diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/shell.py twill-0.9/twill/shell.py --- twill-0.9~b1/twill/shell.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/shell.py 2007-12-28 06:45:16.000000000 +0000 @@ -354,6 +354,9 @@ success.append(filename) except Exception, e: if options.fail: +# import pdb +# _, _, tb = sys.exc_info() +# pdb.post_mortem(tb) raise else: print '** UNHANDLED EXCEPTION:', str(e) diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/utils.py twill-0.9/twill/utils.py --- twill-0.9~b1/twill/utils.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/utils.py 2007-12-28 06:45:16.000000000 +0000 @@ -11,28 +11,11 @@ import subprocess -import mechanize, ClientForm -from mechanize._util import time -from mechanize._http import HTTPRefreshProcessor -from mechanize import BrowserStateError - -class FakeResponse: - def __init__(self, data, url, info): - self.fp = StringIO(data) - self.url = url - self._info = info - - def read(self, *args): - return self.fp.read(*args) - - def seek(self, *args): - return self.fp.seek(*args) - - def info(self): - return self._info - - def geturl(self): - return self.url +import _mechanize_dist as mechanize +from _mechanize_dist import ClientForm +from _mechanize_dist._util import time +from _mechanize_dist._http import HTTPRefreshProcessor +from _mechanize_dist import BrowserStateError class ResultWrapper: """ @@ -161,7 +144,7 @@ return True return False - raise Exception("unable to convert '%s' into true/false..." % (value,)) + raise TwillException("unable to convert '%s' into true/false" % (value,)) def set_form_control_value(control, val): """ @@ -263,6 +246,7 @@ # _tidy_cmd = ["tidy", "-q", "-ashtml"] +_tidy_exists = True def run_tidy(html): """ @@ -271,34 +255,38 @@ Return a 2-tuple (output, errors). (None, None) will be returned if 'tidy' doesn't exist or otherwise fails. """ - global _tidy_cmd + global _tidy_cmd, _tidy_exists from commands import _options require_tidy = _options.get('require_tidy') - + if not _tidy_exists: + if require_tidy: + raise TwillException("tidy does not exist and require_tidy is set") + return (None, None) + # - # run the command + # run the command, if we think it exists # clean_html = None - try: - process = subprocess.Popen(_tidy_cmd, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, bufsize=0, shell=False) - (stdout, stderr) = process.communicate(html) - - clean_html = stdout - errors = stderr - - success = True - except OSError: - success = False - pass + if _tidy_exists: + try: + process = subprocess.Popen(_tidy_cmd, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, bufsize=0, + shell=False) + + (stdout, stderr) = process.communicate(html) + + clean_html = stdout + errors = stderr + except OSError: + _tidy_exists = False errors = None - if (not success or clean_html is None) and require_tidy: - raise Exception("cannot run 'tidy'; \n\t%s\n" % (errors,)) + if require_tidy and clean_html is None: + raise TwillException("tidy does not exist and require_tidy is set") return (clean_html, errors) @@ -373,8 +361,10 @@ if new_html: self._html = new_html - return FakeResponse(self._html, self._url, response.info()) - + return mechanize.make_response(self._html, response._headers.items(), + response._url, response.code, + response.msg) + def use_BS(self): from twill.commands import _options flag = _options.get('use_BeautifulSoup') diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill/wsgi_intercept.py twill-0.9/twill/wsgi_intercept.py --- twill-0.9~b1/twill/wsgi_intercept.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill/wsgi_intercept.py 2007-12-28 06:45:16.000000000 +0000 @@ -268,13 +268,15 @@ if generator_data: self.output.write(generator_data) - for data in self.result: + + while 1: + data = self.result.next() self.output.write(data) + except StopIteration: pass if hasattr(app_result, 'close'): - print 'closing...' app_result.close() if debuglevel >= 2: diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill-fork twill-0.9/twill-fork --- twill-0.9~b1/twill-fork 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill-fork 2007-12-28 06:45:16.000000000 +0000 @@ -1,16 +1,15 @@ -#! /usr/bin/env python2.3 -# +#! /usr/bin/env python # This file is part of the twill source distribution. # # twill is a extensible scriptlet language for testing Web apps, -# available at http://www.idyll.org/~t/www-tools/twill.html. +# available at http://twill.idyll.org/. # -# Contact author: C. Titus Brown, titus@caltech.edu. +# Contact author: C. Titus Brown, titus@idyll.org. # # This program and all associated source code files are Copyright (C) -# 2005 by C. Titus Brown. It is under the Lesser GNU Public License; +# 2005-2007 by C. Titus Brown. It is released under the MIT license; # please see the included LICENSE.txt file for more information, or -# contact Titus directly. +# go to http://www.opensource.org/licenses/mit-license.php. """ twill multiprocess execution system. diff --exclude='*other_packages*' --exclude='*tests*' -urN twill-0.9~b1/twill-sh twill-0.9/twill-sh --- twill-0.9~b1/twill-sh 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9/twill-sh 2007-12-28 06:45:16.000000000 +0000 @@ -1,16 +1,15 @@ -#! /usr/bin/env python2.3 -# +#! /usr/bin/env python # This file is part of the twill source distribution. # # twill is a extensible scriptlet language for testing Web apps, -# available at http://www.idyll.org/~t/www-tools/twill.html. +# available at http://twill.idyll.org/. # -# Contact author: C. Titus Brown, titus@caltech.edu. +# Contact author: C. Titus Brown, titus@idyll.org. # # This program and all associated source code files are Copyright (C) -# 2005 by C. Titus Brown. It is under the Lesser GNU Public License; +# 2005-2007 by C. Titus Brown. It is released under the MIT license; # please see the included LICENSE.txt file for more information, or -# contact Titus directly. +# go to http://www.opensource.org/licenses/mit-license.php. """ twill shell.
Attachment:
pgpXFnFEHVeMD.pgp
Description: PGP signature