Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 341e7fe1b521c24d42319eeead400e23181743bb @lachlan-00 committed Jan 4, 2012
@@ -0,0 +1,18 @@
+uTidylib2 (0.2.1)
+ * Fix handling of 64-bit pointer
+ https://github.com/nijel/utidylib/commit/961f0bc243c5f851da34809ae18b9b8b518a0bbc
+ * Fix handling of unicode strings
+ https://github.com/nijel/utidylib/commit/c3e2adb6d81a5a0ce60905e143ed083dd7a22652
+ * Add 'tidy' to the list of lib names, so it can be imported correctly
+ https://github.com/nijel/utidylib/commit/4d16189fcc45d9486716765676c63d62966cba28
+ -- Lachlan de Waard (lachlan.00@gmail.com)
+
+uTidylib (0.2)
+ * More tests for encoding type stuff
+ * Improve packaging on win32 (include ctypes and libtidy)
+ * Greatly simplify implementation by using tidyParseOptValue() API
+ -- Cory Dodt (corydodt@twistedmatrix.com)
+
+uTidylib (0.1)
+ * Initial release.
+ -- Cory Dodt (corydodt@twistedmatrix.com)
@@ -0,0 +1,123 @@
+If you're reading this, you are probably using a platform that
+doesn't have binaries available. Check anyway:
+
+http://sourceforge.net/project/showfiles.php?group_id=84459
+
+You may also want to consult this document if you get the message:
+"Couldn't find libtidy, please make sure it is installed correctly."
+
+==================================================================
+On Linux (instructions for other flavors of Unix mostly the same):
+___________________
+1. Install libtidy:
+
+TidyLib can be obtained from http://tidy.sourceforge.net/src/tidy_src.tgz
+
+(1a) Compile
+
+$ tar xvfz tidy_src.tgz
+$ cd tidy
+$ sh build/gnuauto/setup.sh
+$ ./configure # may want to specify --prefix=/usr here, see below
+$ make
+
+
+(1b) Install
+(become root)
+# make install
+
+This will place libtidy in /usr/local/lib. If you use --prefix=/usr in
+the configure line flagged above, your library will go to /usr/lib
+instead. The directory you install the library into MUST be
+configured with ldconfig, so if you installed into /usr/local/lib and
+it's mysteriously not working:
+
+# man ldconfig
+# man ld.so.conf
+
+Other Unices may have some variant of ldconfig, or they may use an
+environment variable such as LIBPATH, LD_LIBRARY_PATH, etc.
+
+__________________
+2. Install ctypes:
+
+Ctypes is available from:
+http://sourceforge.net/project/showfiles.php?group_id=71702
+
+_________________________________
+3. Install uLibtidy python files:
+
+(as root)
+# cd uTidylib
+# python setup.py install
+
+
+
+==================================================================
+On Windows:
+__________________
+1. Install libtidy
+
+TidyLib can be obtained from http://tidy.sourceforge.net/src/tidy_src.tgz
+
+libtidy provides 2 ways to compile on Windows. The first way is to
+use the project and makefiles in uTidylib/libtidy/build/msvc. This
+way is not recommended as it requires you to purchase MS Visual C++.
+
+1a) Install Cygwin
+The second, recommended way is to install Cygwin, with at least the
+following packages:
+make, automake, libtool, gcc, and gcc-mingw
+It is recommended that you do _not_ install Cygwin Python; instead use
+the Windows installer at http://python.org/download/ .
+
+1b) Compile
+We will compile with the mingw compiler, which produces binaries that
+do not depend on the Cygwin DLLs.
+$ tar xvfz tidy_src.tgz
+$ cd tidy
+$ sh build/gnuauto/setup.sh
+$ CFLAGS=-mno-cygwin ./configure
+$ make
+
+1c) Copy DLL to a directory in the PATH:
+
+$ cp src/.libs/cygtidy-0-99-0.dll $SYSTEMROOT
+
+__________________
+2. Install ctypes:
+
+Ctypes is available from:
+http://sourceforge.net/project/showfiles.php?group_id=71702
+
+_________________________________
+3. Install uLibtidy python files:
+
+$ cd uTidylib
+$ python setup.py install
+
+
+==================================================================
+Running tests (after installing):
+_________________________________
+
+Running tests requires that you have installed Twisted
+(http://twistedmatrix.com), as uTidyLib uses the trial framework for
+testing.
+
+$ python -c "from twisted.scripts import trial; trial.run()" -p tidylib
+
+This should work on either Windows or Unix.
+
+
+==================================================================
+The Doc:
+________
+
+To build the doc, just run:
+
+$ python gendoc.py
+
+(This requires that you have epydoc installed.)
+
+The API documentation will be built in the ``apidoc'' directory.
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) 2003 Cory Dodt <corydodt@twistedmatrix.com>
+
+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.
@@ -0,0 +1,7 @@
+include INSTALL.txt
+include LICENSE
+include *.py
+include README.*
+include MANIFEST.in
+include tidy/README.*
+include tidy/pvt_ctypes/README.*
@@ -0,0 +1,10 @@
+**This applies to the file path.py, not uTidyLib. Please see the text
+file LICENSE for information about uTidyLib.**
+
+License: You may use path.py for whatever you wish, at your own
+risk. (For example, you may modify, relicense, and redistribute it.)
+It is provided without any guarantee or warranty of any kind, not even
+for merchantability or fitness for any purpose.
+
+If you do make changes to path.py, please consider sending them along
+to me at jason@jorendorff.com.
@@ -0,0 +1,37 @@
+This is uTidylib, the Python wrapper for the HTML cleaning
+library named TidyLib: http://tidy.sf.net . Python 2.3 or later
+is required to use uTidylib. Repeat, Python 2.3 or later is
+*required* to use uTidylib.
+
+Once installed, there are two ways to get help. The simplest is:
+
+$ python
+>>> import tidy
+>>> help(tidy)
+. . .
+
+Then, of course, there's the epydoc-generated API documentation, which
+is available at site-packages/tidy/apidoc/index.html .
+
+__________________
+
+10 Second Tutorial
+__________________
+
+>>> import tidy
+>>> options = dict(output_xhtml=1, add_xml_decl=1, indent=1, tidy_mark=0)
+>>> print tidy.parseString('<Html>Hello Tidy!', **options)
+<?xml version="1.0" encoding="us-ascii"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title></title>
+ </head>
+ <body>
+ Hello Tidy!
+ </body>
+</html
+
+
+Good luck!
@@ -0,0 +1,14 @@
+import sys
+from epydoc.cli import cli
+
+
+def run(argv=sys.argv):
+ argv_old = sys.argv
+ sys.argv = argv
+ cli()
+ sys.argv = argv_old
+
+if __name__ == '__main__':
+ tidypys = 'tidy/error.py tidy/lib.py tidy/__init__.py'
+ default = ('epydoc -o apidoc ' + tidypys).split()
+ run(default)
@@ -0,0 +1,15 @@
+
+@from setup import setup_data
+@ver = setup_data['version']
+
+all: dist/uTidylib-$(ver).zip dist/uTidylib-$(ver).win32.exe
+ :print : Done with all
+
+dist/uTidylib-$(ver).zip: setup.py
+ :sys python setup.py sdist
+
+dist/uTidylib-$(ver).win32.exe: setup.py
+ tidy/cygtidy-0-99-0.dll
+ tidy/pvt_ctypes/ctypes.zip
+ tidy/pvt_ctypes/_ctypes.pyd
+ :sys python setup.py bdist_wininst
@@ -0,0 +1,78 @@
+from path import path
+from distutils.core import setup
+from distutils.command.install import install
+from distutils.command.install_data import install_data
+from distutils.command.bdist_wininst import bdist_wininst
+from distutils import sysconfig
+
+# pack the doc in as data files
+apidoc = path('apidoc')
+data_files = []
+dfa = data_files.append
+pkgdir = path('tidy')
+if apidoc.isdir():
+ dfa((str(pkgdir / apidoc), map(str, apidoc.files())))
+ for p in path('apidoc').walkdirs():
+ dfa((str(pkgdir / p), map(str, p.files())))
+
+
+class bdist_wininst_utidylib(bdist_wininst):
+ def finalize_options(self):
+ dfa = self.distribution.data_files.append
+ dfa((str(pkgdir), [str(pkgdir / 'cygtidy-0-99-0.dll'),
+ str(pkgdir / 'README.tidydll')]
+ ))
+ private_ctypes = pkgdir / 'pvt_ctypes'
+ dfa((str(private_ctypes), [str(private_ctypes / 'ctypes.zip'),
+ str(private_ctypes / '_ctypes.pyd'),
+ str(private_ctypes / 'README.ctypes')]
+ ))
+
+ # TODO - make it impossible to install on python2.2
+ bdist_wininst.finalize_options(self)
+
+
+# make sure data files are installed in tidylib package during binary
+# build phase - this is evil.
+class install_data_utidylib(install_data):
+ def finalize_options(self):
+ self.set_undefined_options('install',
+ ('install_lib', 'install_dir'))
+ install_data.finalize_options(self)
+
+
+class install_utidylib(install):
+ def run(self):
+ install.run(self)
+ print "*** This library requires that you have two libraries ***"
+ print "*** installed: ctypes and libtidy. ***"
+ print "*** Please make sure they are installed correctly ***"
+ print "*** before reporting a bug. ***"
+ print "*** See: ***"
+ print "*** http://starship.python.net/crew/theller/ctypes/ ***"
+ print "*** and http://tidy.sourceforge.net ***"
+ print "*** (or consult your vendor documentation for binary ***"
+ print "*** packages.) ***"
+
+
+setup_data = dict(packages=['tidy', ],
+ data_files=data_files,
+ cmdclass=dict(install_data=install_data_utidylib,
+ bdist_wininst=bdist_wininst_utidylib,
+ install=install_utidylib,
+ ),
+ name='uTidylib',
+ version='0.2+cvs',
+ author='Cory Dodt',
+ author_email='corydodt@twistedmatrix.com',
+ url='http://utidylib.sf.net',
+ description='Wrapper for HTML Tidy at '
+ 'http://tidy.sourceforge.net',
+ long_description='''\
+A wrapper for the relocatable version of HTML Tidy (see
+http://tidy.sourceforge.net for details). This allows you to
+tidy HTML files through a Pythonic interface.'''
+ )
+
+if __name__ == '__main__':
+ setup(**setup_data)
@@ -0,0 +1,41 @@
+** This notice applies only to the tidy DLL distributed with the Windows binary
+package of uTidylib. See the file LICENSE for information about uTidyLib. **
+
+HTML Tidy
+
+HTML parser and pretty printer
+
+Copyright (c) 1998-2003 World Wide Web Consortium
+(Massachusetts Institute of Technology, European Research
+Consortium for Informatics and Mathematics, Keio University).
+All Rights Reserved.
+
+This software and documentation is provided "as is," and
+the copyright holders and contributing author(s) make no
+representations or warranties, express or implied, including
+but not limited to, warranties of merchantability or fitness
+for any particular purpose or that the use of the software or
+documentation will not infringe any third party patents,
+copyrights, trademarks or other rights.
+
+The copyright holders and contributing author(s) will not be held
+liable for any direct, indirect, special or consequential damages
+arising out of any use of the software or documentation, even if
+advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute
+this source code, or portions hereof, documentation and executables,
+for any purpose, without fee, subject to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+2. Altered versions must be plainly marked as such and must
+ not be misrepresented as being the original source.
+3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The copyright holders and contributing author(s) specifically
+permit, without fee, and encourage the use of this source code
+as a component for supporting the Hypertext Markup Language in
+commercial products. If you use this source code in a product,
+acknowledgment is not required but would be appreciated.
+
Oops, something went wrong.

1 comment on commit 341e7fe

Owner

lachlan-00 commented on 341e7fe Jan 8, 2012

This first commit includes debian patches as well as code fixes

Please sign in to comment.