debian/0000755000000000000000000000000012302376641007172 5ustar debian/docs0000644000000000000000000000001311370037411010030 0ustar README.txt debian/copyright0000644000000000000000000000245711370035226011130 0ustar This package was originally debianized by Chad Walstrom on Mon, 20 Dec 2004 15:18:53 -0600 It was downloaded from http://download.berlios.de/utidylib/uTidylib-0.2.zip Copyright: Copyright (c) 2003 Cory Dodt 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. debian/changelog0000644000000000000000000000561712302376641011055 0ustar utidylib (0.2-9build1) trusty; urgency=medium * Rebuild to drop files installed into /usr/share/pyshared. -- Matthias Klose Sun, 23 Feb 2014 13:54:41 +0000 utidylib (0.2-9) unstable; urgency=low [ Michal Čihař ] * Bump standards to 3.9.4. * Use debhelper 9. * Updated watchfile. [ Jakub Wilk ] * Use canonical URIs for Vcs-* fields. * Set Debian Python Modules Team as maintainer (in place of Python Applications Packaging Team). * Drop obsolete Breaks/Replaces with python2.3-utidylib and python2.4-utidylib. -- Michal Čihař Thu, 31 Oct 2013 10:08:25 +0100 utidylib (0.2-8) unstable; urgency=low * Team upload. * Rebuild to add Python 2.7 support -- Piotr Ożarowski Sun, 08 May 2011 16:45:30 +0200 utidylib (0.2-7) unstable; urgency=low * Bump standards to 3.9.1. * Switch to dh_python2. -- Michal Čihař Mon, 07 Mar 2011 10:48:18 +0100 utidylib (0.2-6) unstable; urgency=low * Add support for handling unicode strings (Closes: #339818). -- Michal Čihař Tue, 29 Jun 2010 14:47:17 +0200 utidylib (0.2-5) unstable; urgency=low * Fix handling of pointer on 64-bit (LP: #307000). * Replace Conflicts with Breaks for older package versions. * Bump standards to 3.9.0. -- Michal Čihař Tue, 29 Jun 2010 10:42:50 +0200 utidylib (0.2-4) unstable; urgency=low * New maintainer. * Remove depdency on python-ctypes (Closes: #580215). * Convert patch to quilt and use 3.0 source format. * Switch build system to dh from cdbs. * Bump standards to 3.8.4. * Add ${misc:Depends}. * Change section to python. * Add homepage control field. * Add Vcs-* control fields. * No need to ship source readme in binary package. -- Michal Čihař Tue, 04 May 2010 17:35:13 +0200 utidylib (0.2-3.2) unstable; urgency=low * Non-maintainer upload. * Fixes dependency on python-ctypes (Closes: #476276). -- Michal Čihař Tue, 15 Apr 2008 16:42:24 +0200 utidylib (0.2-3.1) unstable; urgency=low * Non-maintainer upload. * Update to new Python Policy (Closes: #373404). -- Pierre Habouzit Thu, 29 Jun 2006 14:48:22 +0200 utidylib (0.2-3) unstable; urgency=low * debian/control: changed dependency on libtidy from libtidy0 to libtidy-0.99-0 (Closes: #343991) -- Igor Stroh Mon, 26 Dec 2005 12:42:30 +0100 utidylib (0.2-2) unstable; urgency=low * debian/control: added missing python-dev dependency (Closes: #325679). Thanks to Andreas Jochens. -- Igor Stroh Tue, 30 Aug 2005 10:27:34 +0200 utidylib (0.2-1) unstable; urgency=low * Initial release (Closes: #244110) * Thanks to Chad Walstrom for providing the original CDBS-based packaging infrastructure -- Igor Stroh Sun, 21 Aug 2005 10:18:04 +0200 debian/compat0000644000000000000000000000000212234416541010366 0ustar 9 debian/patches/0000755000000000000000000000000012234417037010620 5ustar debian/patches/unicode-strings.patch0000644000000000000000000000122311412366131014747 0ustar From: Michal Čihař Subject: Fix handling of unicode strings Forwarded: https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=3011&group_id=1810 --- a/tidy/lib.py +++ b/tidy/lib.py @@ -204,6 +204,13 @@ @param st: the string to parse @return: a document object """ + if type(st) == unicode: + try: + enc = kwargs['char_encoding'] + except KeyError: + enc = 'utf8' + kwargs['char_encoding'] = enc + st = st.encode(enc) doc = self._create(**kwargs) self.loadString(doc, st) return doc debian/patches/series0000644000000000000000000000010611412365372012033 0ustar unicode-strings.patch fix_libtidy_import.patch fix-pointer-size.patch debian/patches/fix_libtidy_import.patch0000644000000000000000000000115611370036515015542 0ustar From: Igor Stroh Subject: Add 'tidy' to the list of lib names, so it can be imported correctly in debian --- utidylib-0.2.old/tidy/lib.py 2005-08-21 11:21:38.000000000 +0200 +++ utidylib-0.2/tidy/lib.py 2005-08-21 11:20:06.000000000 +0200 @@ -22,7 +22,7 @@ # directory too thelib=None os.environ['PATH'] = "%s%s%s" % (packagedir, os.pathsep, os.environ['PATH']) -for libname in ('cygtidy-0-99-0', 'libtidy', 'libtidy.so', +for libname in ('tidy', 'cygtidy-0-99-0', 'libtidy', 'libtidy.so', 'libtidy-0.99.so.0', 'tidylib'): try: thelib = getattr(ctypes.cdll, libname) debian/patches/fix-pointer-size.patch0000644000000000000000000000602611370523305015055 0ustar Subject: Fix handling of 64-bit pointer Origin: http://developer.berlios.de/bugs/?func=detailbug&bug_id=14691&group_id=1810 --- a/tidy/lib.py +++ b/tidy/lib.py @@ -18,7 +18,7 @@ import weakref from tidy.error import * -# search the path for libtidy using the known names; try the package +# search the path for libtidy using the known names; try the package # directory too thelib=None os.environ['PATH'] = "%s%s%s" % (packagedir, os.pathsep, os.environ['PATH']) @@ -33,7 +33,7 @@ raise OSError("Couldn't find libtidy, please make sure it is installed.") class Loader: - """I am a trivial wrapper that eliminates the need for tidy.tidyFoo, + """I am a trivial wrapper that eliminates the need for tidy.tidyFoo, so you can just access tidy.Foo """ def __init__(self): @@ -46,6 +46,7 @@ return getattr(self.lib, name) _tidy=Loader() +_tidy.Create.restype = ctypes.POINTER(ctypes.c_void_p) # define a callback to pass to Tidylib def _putByte(handle, c): @@ -53,7 +54,7 @@ sinkfactory[handle].putByte(c) return 0 -PUTBYTEFUNC=ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char) +PUTBYTEFUNC=ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char) putByte=PUTBYTEFUNC(_putByte) class _OutputSink(ctypes.Structure): @@ -94,7 +95,7 @@ return "line %d col %d - %s: %s" % (self.line, self.col, severities[self.severity], self.message) - + else: return "%s: %s" % (severities[self.severity], self.message) except KeyError: @@ -103,7 +104,7 @@ def __repr__(self): return "%s('%s')" % (self.__class__.__name__, str(self).replace("'", "\\'")) - + class FactoryDict(dict): """I am a dict with a create method and no __setitem__. This allows me to control my own keys. @@ -114,7 +115,7 @@ dict.__setitem__(self, name, value) def __setitem__(self, name, value): raise TypeError, "Use create() to get a new object" - + class SinkFactory(FactoryDict): """Mapping for lookup of sinks by handle""" @@ -161,12 +162,12 @@ class DocumentFactory(FactoryDict): def _setOptions(self, doc, **options): for k in options.keys(): - + # this will flush out most argument type errors... if options[k] is None: options[k] = '' - - _tidy.OptParseValue(doc.cdoc, - k.replace('_', '-'), + + _tidy.OptParseValue(doc.cdoc, + k.replace('_', '-'), str(options[k])) if doc.errors: match=filter(doc.errors[-1].message.startswith, errors.keys()) @@ -209,7 +210,7 @@ return doc def releaseDoc(self, ref): _tidy.Release(self[ref]) - + docfactory = DocumentFactory() parse = docfactory.parse parseString = docfactory.parseString debian/README.Debian0000644000000000000000000000143611370037202011226 0ustar uTidyLib for Debian =================== The debian package of uTidyLib does not include the API docs, however these can be easily generated using epydoc (package python-epydoc). Just run the following commands: $ export PYTHON_VERSION="2.3" # replace 2.3 with appropriate version $ export PACKAGES_HOME="/usr/lib/python$PYTHON_VERSION/site-packages/" $ export APIDOC_OUTPUT="python$PYTHON_VERSION-utidylib-apidoc" $ epydoc -o "$APIDOC_OUTPUT" $PACKAGES_HOME/tidy/error.py \ $PACKAGES_HOME/tidy/lib.py \ $PACKAGES_HOME/tidy/__init__.py You might also want to visit the project's homepage at http://utidylib.berlios.de/ for more details about the usage of this library. -- Igor Stroh Sun, 21 Aug 2005 10:18:04 +0200 debian/control0000644000000000000000000000255312234416535010603 0ustar Source: utidylib Section: python Priority: optional Maintainer: Debian Python Modules Team Uploaders: Michal Čihař Build-Depends: debhelper (>= 9) Build-Depends-Indep: python-all (>= 2.6.6-3) Standards-Version: 3.9.4 Homepage: http://utidylib.berlios.de/ Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/utidylib/trunk/ Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/utidylib/trunk/ Package: python-utidylib Architecture: all Depends: ${python:Depends}, ${misc:Depends}, libtidy-0.99-0 (>= 20051018) Provides: ${python:Provides} Breaks: ${python:Breaks} Description: Python wrapper for TidyLib Corrects markup in a way compliant with the latest standards, and optimal for the popular browsers. It has a comprehensive knowledge of the attributes defined in the HTML 4.0 recommendation from W3C, and understands the US ASCII, ISO Latin-1, UTF-8 and the ISO 2022 family of 7-bit encodings. In the output: . * HTML entity names for characters are used when appropriate. * Missing attribute quotes are added, and mismatched quotes found. * Tags lacking a terminating '>' are spotted. * Proprietary elements are recognized and reported as such. * The page is reformatted, from a choice of indentation styles. . This package contains uTidylib, a Python wrapper for TidyLib. debian/rules0000755000000000000000000000005512234416577010261 0ustar #!/usr/bin/make -f %: dh $@ --with python2 debian/source/0000755000000000000000000000000012234417037010471 5ustar debian/source/format0000644000000000000000000000001411370036535011677 0ustar 3.0 (quilt) debian/README.source0000644000000000000000000000137011370037341011345 0ustar Since the upstream provides only a .zip archive, we need to repackage it into a .tar.gz: 1) Download the current version from http://download.berlios.de/utidylib/uTidylib-$VERSION.zip where $VERSION is the latest available upstream release. You can use the `uscan` program to retrieve the newest version of this file, just point it to the unpacked utidylib source directory (must include the "debian/" folder). 2) Unpack the ZIP archive, rename the resulting directory to utidylib-$VERSION.orig and run create the .orig.tar.gz: $ unzip uTidylib-$VERSION.zip $ mv uTidylib-$VERSION utidylib-$VERSION $ tar czvf utidylib_$VERSION.orig.tar.gz utidylib-$VERSION -- Igor Stroh Sun, 21 Aug 2005 10:18:04 +0200 debian/watch0000644000000000000000000000017512234416750010226 0ustar version=3 http://developer.berlios.de/project/showfiles.php?group_id=1810 .*/uTidylib-(\d.*)\.(?:tgz|tar\.(?:gz|bz2|xz)|zip)