debian/0000755000000000000000000000000011666710635007201 5ustar debian/control0000644000000000000000000000214411666710501010575 0ustar Source: twill Section: python Priority: optional Maintainer: Arnaud Fontaine Uploaders: Debian Python Modules Team Build-Depends: debhelper (>= 5.0.37.2), cdbs (>= 0.4.90~), python (>= 2.6.6-3~) Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml Standards-Version: 3.9.2 X-Python-Version: >= 2.3 Homepage: http://twill.idyll.org/ Vcs-Svn: svn://svn.debian.org/python-modules/packages/twill/trunk/ 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.2.0~), python-pyparsing (>= 1.4.1) Recommends: doc-base Description: Simple scripting language for Web browsing Twill is a simple scripting language intended for programmatic or 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. debian/source/0000755000000000000000000000000011666710635010501 5ustar debian/source/format0000644000000000000000000000001411552703450011676 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000020611552703450010217 0ustar version=3 opts="uversionmangle=s/b/~b/" http://twill.idyll.org/ http://darcs.idyll.org/~t/projects/twill-(.*)\.tar\.gz debian uupdate debian/compat0000644000000000000000000000000211552703450010366 0ustar 5 debian/copyright0000644000000000000000000003422311666705565011146 0ustar This package was debianized by Arnaud Fontaine on Sun, 08 Apr 2007 10:37:43 +0200. It was downloaded from http://twill.idyll.org/ Author: C. Titus Brown Copyright (c) 2005-2010 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: 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. In addition of twill main code, the following module are distributed along with twill under the following licenses: 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-2010 John J. Lee 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-2010 John J Lee Copyright 1997-2010 Gisle Aas (original libwww-perl code) Copyright 2002-2010 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-2010 John J. Lee Copyright 1997-2010 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-2010 John J. Lee Copyright 2003-2010 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. File: twill/other_packages/_mechanize_dist/_msiecookiejar.py Copyright 2002-2010 Johnny Lee (MSIE Perl code) Copyright 2002-2010 John J Lee (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-2010 John J. Lee Copyright 2005-2010 Gary Poster Copyright 2005-2010 Zope Corporation Copyright 1998-2010 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-2010 Leonard Richardson License: PSF LICENSE AGREEMENT FOR PYTHON 2.3 ------------------------------------ 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 2.3 software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 2.3 alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002 Python Software Foundation; All Rights Reserved" are retained in Python 2.3 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 2.3 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 2.3. 4. PSF is making Python 2.3 available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.3 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python 2.3, Licensee agrees to be bound by the terms and conditions of this License Agreement. File: twill/other_packages/pyparsing.py Copyright (c) 2003-2010 Paul T. McGuire License: 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 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. File: twill/other_packages/subprocess.py Copyright (c) 2003-2010 by Peter Astrand License: PSF LICENSE AGREEMENT FOR PYTHON 2.4 ------------------------------------ 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 2.4 software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 2.4 alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved" are retained in Python 2.4 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 2.4 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 2.4. 4. PSF is making Python 2.4 available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.4 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 2.4 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.4, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python 2.4, Licensee agrees to be bound by the terms and conditions of this License Agreement. The Debian packaging is (C) 2007-2010, Arnaud Fontaine 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-2'. debian/dirs0000644000000000000000000000004011552703450010046 0ustar usr/share/doc/python-twill/html debian/changelog0000644000000000000000000000560611666710544011061 0ustar twill (0.9-3) unstable; urgency=low * Add debian/patches/04_fix_deprecated_ClientForm.patch as ClientForm is now shipped with mechanize. + debian/rules: - Drop Depends on python-clientform. + debian/control: - Bump python-mechanize Depends to >= 0.2.0~. * debian/patches/02_remove_ext.patch: + Fix tests as well. * Add debian/patches/05_fix_missing_imports.patch. * debian/control: + Bump Standards-Version to 3.9.2. No changes needed. * Switch from now deprecated pysupport to dh_python2. + Drop debian/pyversions and debian/pycompat. + debian/rules: - Remove DEB_PYTHON_SYSTEM. + debian/control: - Add X-Python-Version field. - Bump python and cdbs versions. -- Arnaud Fontaine Sun, 04 Dec 2011 23:35:55 +0900 twill (0.9-2) unstable; urgency=low * debian/control: + Replace python-dev by python in Build-Depends. + Bump Standards-Version to 3.8.4. No changes needed. + Drop now useless debian/README.source. * debian/copyright: + Update copyright years. * Switch to dpkg-source 3.0 (quilt) format. + Remove Build-Depends on quilt in debian/control. + Remove include of patchsys-quilt.mk in debian/rules. -- Arnaud Fontaine Sun, 16 May 2010 13:52:13 +0100 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 Wed, 21 Jan 2009 23:54:29 +0000 twill (0.9~b1-2) unstable; urgency=low [ Arnaud Fontaine ] * New email address. * Use quilt patch system instead of simple patchsys. * Remove useless debian/control.in. * Drop useless dependency on python-setuptools, use distutils instead. + Add debian/patches/03_no_setuptools.patch. * debian/patches/01_fix_history_path.patch: + Check whether HOME environment variable is set before using it. * debian/control: + Now depend on python-mechanize >= 0.1.7b-2 because it fixes #456944. + Update Standards-Version to 3.7.3. No changes needed. [ Piotr Ożarowski ] * Added debian/watch file. * Vcs-Svn, Vcs-Browser and Homepage fields added (dpkg support them now). -- Arnaud Fontaine Fri, 21 Dec 2007 03:04:41 +0000 twill (0.9~b1-1) unstable; urgency=low * Initial release. Closes: #387152. -- Arnaud Fontaine Sun, 08 Apr 2007 10:37:43 +0200 debian/patches/0000755000000000000000000000000011666710635010630 5ustar debian/patches/series0000644000000000000000000000020511655706541012041 0ustar 01_fix_history_path.patch 02_remove_ext.patch 03_no_setuptools.patch 04_fix_deprecated_ClientForm.patch 05_fix_missing_imports.patch debian/patches/05_fix_missing_imports.patch0000644000000000000000000000067611655706541016261 0ustar Index: twill-0.9/twill/utils.py =================================================================== --- twill-0.9.orig/twill/utils.py 2011-11-07 16:44:06.000000000 +0900 +++ twill-0.9/twill/utils.py 2011-11-07 16:47:51.346998902 +0900 @@ -16,6 +16,7 @@ from mechanize._util import time from mechanize._http import HTTPRefreshProcessor from mechanize import BrowserStateError +from errors import TwillException class ResultWrapper: """ debian/patches/01_fix_history_path.patch0000644000000000000000000000232111653716231015524 0ustar Index: twill-0.9~b1/twill/shell.py =================================================================== --- twill-0.9~b1.orig/twill/shell.py 2007-03-06 23:00:05.000000000 +0000 +++ twill-0.9~b1/twill/shell.py 2007-12-21 02:56:21.000000000 +0000 @@ -102,10 +102,17 @@ # initialize a new local namespace. namespaces.new_local_dict() + # The history file name is located in the home directory of + # the user + import os + self._history_file = os.environ.has_key("HOME") and \ + os.path.join(os.environ["HOME"], ".twill_history") or \ + None + # import readline history, if available. - if readline: + if self._history_file and readline: try: - readline.read_history_file('.twill-history') + readline.read_history_file(self._history_file) except IOError: pass @@ -236,8 +243,8 @@ def do_EOF(self, *args): "Exit on CTRL-D" - if readline: - readline.write_history_file('.twill-history') + if self._history_file and readline: + readline.write_history_file(self._history_file) raise SystemExit() debian/patches/02_remove_ext.patch0000644000000000000000000001260311653716231014323 0ustar Index: twill-0.9/setup.py =================================================================== --- twill-0.9.orig/setup.py 2007-12-28 15:45:16.000000000 +0900 +++ twill-0.9/setup.py 2011-11-01 16:07:25.679717491 +0900 @@ -18,8 +18,7 @@ author_email = 'titus@idyll.org', license='MIT', - packages = ['twill', 'twill.other_packages', - '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 15:45:16.000000000 +0900 +++ twill-0.9/twill/_browser.py 2011-11-01 15:50:22.000000000 +0900 @@ -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 15:45:16.000000000 +0900 +++ twill-0.9/twill/browser.py 2011-11-01 16:07:24.295717438 +0900 @@ -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 15:45:16.000000000 +0900 +++ twill-0.9/twill/commands.py 2011-11-01 16:07:24.287717438 +0900 @@ -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 15:45:16.000000000 +0900 +++ twill-0.9/twill/utils.py 2011-11-01 16:07:24.303717438 +0900 @@ -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: """ Index: twill-0.9/tests/test-broken-html.py =================================================================== --- twill-0.9.orig/tests/test-broken-html.py 2007-12-28 15:45:16.000000000 +0900 +++ twill-0.9/tests/test-broken-html.py 2011-11-01 16:12:57.815730121 +0900 @@ -3,8 +3,6 @@ parser) can parse. """ -from _mechanize_dist import ClientForm - import twilltestlib from twill import commands Index: twill-0.9/tests/test-checkbox.py =================================================================== --- twill-0.9.orig/tests/test-checkbox.py 2007-12-28 15:45:16.000000000 +0900 +++ twill-0.9/tests/test-checkbox.py 2011-11-01 16:12:48.751729776 +0900 @@ -2,7 +2,8 @@ import twill from twill import namespaces, commands from twill.errors import TwillAssertionError -from _mechanize_dist import BrowserStateError, ClientForm +import mechanize +import ClientForm def setup_module(): global url @@ -15,7 +16,7 @@ try: browser.get_title() assert 0, "should never get here" - except BrowserStateError: + except mechanize.BrowserStateError: pass commands.go(url) @@ -53,7 +54,7 @@ try: browser.get_title() assert 0, "should never get here" - except BrowserStateError: + except mechanize.BrowserStateError: pass commands.go(url) Index: twill-0.9/tests/test-encoding.py =================================================================== --- twill-0.9.orig/tests/test-encoding.py 2007-12-28 15:45:16.000000000 +0900 +++ twill-0.9/tests/test-encoding.py 2011-11-01 16:11:54.079727697 +0900 @@ -1,5 +1,5 @@ import twilltestlib -from _mechanize_dist import ClientForm +import ClientForm from cStringIO import StringIO def test_form_parse(): Index: twill-0.9/tests/test-form.py =================================================================== --- twill-0.9.orig/tests/test-form.py 2007-12-28 15:45:16.000000000 +0900 +++ twill-0.9/tests/test-form.py 2011-11-01 16:13:20.135730970 +0900 @@ -2,7 +2,8 @@ import twill from twill import namespaces, commands from twill.errors import TwillAssertionError -from _mechanize_dist import BrowserStateError, ClientForm +import ClientForm +import mechanize def test(): url = twilltestlib.get_url() @@ -14,7 +15,7 @@ try: browser.get_title() assert 0, "should never get here" - except BrowserStateError: + except mechanize.BrowserStateError: pass ### now test a few special cases debian/patches/03_no_setuptools.patch0000644000000000000000000000154111653716231015063 0ustar Index: twill-0.9~b1/setup.py =================================================================== --- twill-0.9~b1.orig/setup.py 2007-12-21 03:34:13.000000000 +0000 +++ twill-0.9~b1/setup.py 2007-12-21 03:34:22.000000000 +0000 @@ -1,10 +1,6 @@ #!/usr/bin/env python -try: - from setuptools import setup -except ImportError: - print '(WARNING: importing distutils, not setuptools!)' - from distutils.core import setup +from distutils.core import setup #### twill info. @@ -22,9 +18,7 @@ 'twill.extensions', 'twill.extensions.match_parse'], - # allow both - entry_points = dict(console_scripts=['twill-sh = twill.shell:main'],), - scripts = ['twill-fork'], + scripts = ['twill-fork', 'twill-sh'], maintainer = 'C. Titus Brown', maintainer_email = 'titus@caltech.edu', debian/patches/04_fix_deprecated_ClientForm.patch0000644000000000000000000001465611653716231017252 0ustar Index: twill-0.9/twill/browser.py =================================================================== --- twill-0.9.orig/twill/browser.py 2011-11-01 16:07:24.295717438 +0900 +++ twill-0.9/twill/browser.py 2011-11-01 16:14:07.983732789 +0900 @@ -11,7 +11,7 @@ # wwwsearch imports import mechanize -import ClientForm +import mechanize from mechanize import BrowserStateError, LinkNotFoundError # twill package imports @@ -389,7 +389,7 @@ self.last_submit_button = None # record the last submit button clicked. - if isinstance(control, ClientForm.SubmitControl): + if isinstance(control, mechanize.SubmitControl): self.last_submit_button = control def submit(self, fieldname=None): @@ -421,7 +421,7 @@ else: # get first submit button in form. submits = [ c for c in form.controls \ - if isinstance(c, ClientForm.SubmitControl) ] + if isinstance(c, mechanize.SubmitControl) ] if len(submits): ctl = submits[0] @@ -441,7 +441,7 @@ Note: submit is using submit button: name="%s", value="%s" """ % (ctl.name, ctl.value) - if isinstance(ctl, ClientForm.ImageControl): + if isinstance(ctl, mechanize.ImageControl): request = ctl._click(form, (1,1), "", mechanize.Request) else: request = ctl._click(form, True, "", mechanize.Request) Index: twill-0.9/twill/commands.py =================================================================== --- twill-0.9.orig/twill/commands.py 2011-11-01 16:07:24.287717438 +0900 +++ twill-0.9/twill/commands.py 2011-11-01 16:14:07.983732789 +0900 @@ -5,7 +5,7 @@ import sys import mechanize -import ClientForm +import mechanize from mechanize._headersutil import is_html OUT=None @@ -440,11 +440,11 @@ print>>OUT, 'forcing read-only form field to writeable' control.readonly = False - if control.readonly or isinstance(control, ClientForm.IgnoreControl): + if control.readonly or isinstance(control, mechanize.IgnoreControl): print>>OUT, 'form field is read-only or ignorable; nothing done.' return - if isinstance(control, ClientForm.FileControl): + if isinstance(control, mechanize.FileControl): raise TwillException('form field is for file upload; use "formfile" instead') set_form_control_value(control, value) Index: twill-0.9/twill/utils.py =================================================================== --- twill-0.9.orig/twill/utils.py 2011-11-01 16:07:24.303717438 +0900 +++ twill-0.9/twill/utils.py 2011-11-01 16:14:07.983732789 +0900 @@ -12,7 +12,7 @@ import subprocess import mechanize -import ClientForm +import mechanize from mechanize._util import time from mechanize._http import HTTPRefreshProcessor from mechanize import BrowserStateError @@ -150,17 +150,17 @@ """ Helper function to deal with setting form values on checkboxes, lists etc. """ - if isinstance(control, ClientForm.CheckboxControl): + if isinstance(control, mechanize.CheckboxControl): try: checkbox = control.get() checkbox.selected = make_boolean(val) return - except ClientForm.AmbiguityError: + except mechanize.AmbiguityError: # if there's more than one checkbox, use the behaviour for - # ClientForm.ListControl, below. + # mechanize.ListControl, below. pass - if isinstance(control, ClientForm.ListControl): + if isinstance(control, mechanize.ListControl): # # for ListControls (checkboxes, multiselect, etc.) we first need # to find the right *value*. Then we need to set it +/-. @@ -181,13 +181,13 @@ try: item = control.get(name=val) - except ClientForm.ItemNotFoundError: + except mechanize.ItemNotFoundError: try: item = control.get(label=val) - except ClientForm.AmbiguityError: - raise ClientForm.ItemNotFoundError('multiple matches to value/label "%s" in list control' % (val,)) - except ClientForm.ItemNotFoundError: - raise ClientForm.ItemNotFoundError('cannot find value/label "%s" in list control' % (val,)) + except mechanize.AmbiguityError: + raise mechanize.ItemNotFoundError('multiple matches to value/label "%s" in list control' % (val,)) + except mechanize.ItemNotFoundError: + raise mechanize.ItemNotFoundError('cannot find value/label "%s" in list control' % (val,)) if flag: item.selected = 1 Index: twill-0.9/tests/test-checkbox.py =================================================================== --- twill-0.9.orig/tests/test-checkbox.py 2011-11-01 16:12:48.751729776 +0900 +++ twill-0.9/tests/test-checkbox.py 2011-11-01 16:14:59.267734741 +0900 @@ -3,7 +3,6 @@ from twill import namespaces, commands from twill.errors import TwillAssertionError import mechanize -import ClientForm def setup_module(): global url Index: twill-0.9/tests/test-encoding.py =================================================================== --- twill-0.9.orig/tests/test-encoding.py 2011-11-01 16:11:54.079727697 +0900 +++ twill-0.9/tests/test-encoding.py 2011-11-01 16:14:45.851734229 +0900 @@ -1,5 +1,5 @@ import twilltestlib -import ClientForm +import mechanize from cStringIO import StringIO def test_form_parse(): @@ -7,5 +7,5 @@ fp = StringIO(content) # latin-1... - ClientForm.ParseFile(fp, "", encoding='latin-1', - backwards_compat=False) + mechanize.ParseFile(fp, "", encoding='latin-1', + backwards_compat=False) Index: twill-0.9/tests/test-form.py =================================================================== --- twill-0.9.orig/tests/test-form.py 2011-11-01 16:13:20.135730970 +0900 +++ twill-0.9/tests/test-form.py 2011-11-01 16:14:29.291733600 +0900 @@ -2,7 +2,6 @@ import twill from twill import namespaces, commands from twill.errors import TwillAssertionError -import ClientForm import mechanize def test(): @@ -44,7 +43,7 @@ try: commands.fv('1', 'selecttest', 'value') assert 0 - except ClientForm.ItemNotFoundError: + except mechanize.ItemNotFoundError: pass # test ambiguous match to name debian/manpages0000644000000000000000000000004611552703450010706 0ustar debian/twill-fork.1 debian/twill-sh.1 debian/doc-base0000644000000000000000000000053211552703450010570 0ustar Document: twill Title: twill: a simple scripting language for Web browsing Author: C. Titus Brown Abstract: This documentation describes what is twill and how to use it for programming purpose. Section: Programming Format: HTML Index: /usr/share/doc/python-twill/html/index.html Files: /usr/share/doc/python-twill/html/*.html debian/twill-sh.dbk0000644000000000000000000001305111552703450011415 0ustar .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry in a Makefile or Makefile.am is: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ manpages/docbook.xsl XP=xsltproc -''-nonet manpage.1: manpage.dbk $(XP) $(DB2MAN) $< The xsltproc binary is found in the xsltproc package. The XSL files are in docbook-xsl. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include xsltproc and docbook-xsl in your Build-Depends control field. --> Arnaud"> Fontaine"> april 10, 2007"> 1"> arnau@debian.org"> TWILL"> GNU"> GPL"> ]>
&dhemail;
2007 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; a simple scripting language for Web browsing &dhpackage; DESCRIPTION Twill is a simple language that allows users to browse the Web from a command-line interface. With twill, you can navigate through Web sites that use forms, cookies, and most standard Web features. &dhpackage; lets you interactively browse the Web. OPTIONS print usage information Show version information and exit Do not show normal output Drop into an interactive shell after running files if any Exit on first file which fails Continue executing scripts even if errors occur Start at the given URL before each script SEE ALSO twill-fork (1). AUTHORS Twill was written by C. Titus Brown titus@idyll.org and This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the &gnu; General Public License can be found in /usr/share/common-licenses/GPL.
debian/install0000644000000000000000000000005411552703450010560 0ustar doc/*.html usr/share/doc/python-twill/html/ debian/rules0000755000000000000000000000101011666702672010253 0ustar #!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk # Don't compress .py files DEB_COMPRESS_EXCLUDE := .py # Manpages stuff MANPAGES = debian/twill-sh.1 debian/twill-fork.1 XSLT_CMD = xsltproc -nonet DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl %.1: %.dbk cd $( .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry in a Makefile or Makefile.am is: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ manpages/docbook.xsl XP=xsltproc -''-nonet manpage.1: manpage.dbk $(XP) $(DB2MAN) $< The xsltproc binary is found in the xsltproc package. The XSL files are in docbook-xsl. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include xsltproc and docbook-xsl in your Build-Depends control field. --> Arnaud"> Fontaine"> april 10, 2007"> 1"> arnau@debian.org"> TWILL"> GNU"> GPL"> ]>
&dhemail;
2007 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; a simple scripting language for Web browsing &dhpackage; DESCRIPTION Twill is a simple language that allows users to browse the Web from a command-line interface. With twill, you can navigate through Web sites that use forms, cookies, and most standard Web features. You can use the &dhpackage; script to do some stress testing. OPTIONS print usage information Start at the given URL before each script Number of times to run the given script(s) Number of processes to execute in parallel SEE ALSO twill-sh (1). AUTHORS Twill was written by C. Titus Brown titus@idyll.org and This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the &gnu; General Public License can be found in /usr/share/common-licenses/GPL.