4.1 --- a/libxml2dom/__init__.py Sun Jan 29 00:36:39 2012 +0100
4.2 +++ b/libxml2dom/__init__.py Sat Jun 01 17:01:05 2013 +0200
4.3 @@ -3,7 +3,7 @@
4.4 """
4.5 DOM wrapper around libxml2, specifically the libxml2mod Python extension module.
4.6
4.7 -Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Paul Boddie <paul@boddie.org.uk>
4.8 +Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012, 2013 Paul Boddie <paul@boddie.org.uk>
4.9
4.10 This program is free software; you can redistribute it and/or modify it under
4.11 the terms of the GNU Lesser General Public License as published by the Free
4.12 @@ -19,7 +19,7 @@
4.13 with this program. If not, see <http://www.gnu.org/licenses/>.
4.14 """
4.15
4.16 -__version__ = "0.5"
4.17 +__version__ = "0.5.1"
4.18
4.19 from libxml2dom.macrolib import *
4.20 from libxml2dom.macrolib import \
4.21 @@ -28,7 +28,7 @@
4.22 parseFile as Node_parseFile, \
4.23 toString as Node_toString, toStream as Node_toStream, \
4.24 toFile as Node_toFile
4.25 -import urllib # for parseURI in HTML mode
4.26 +import urllib2 # for parseURI in HTML mode
4.27 import libxml2dom.errors
4.28
4.29 # Standard namespaces.
4.30 @@ -707,7 +707,7 @@
4.31 If the optional 'html' parameter is set to a true value, the content to be
4.32 parsed will be treated as being HTML rather than XML. If the optional
4.33 'htmlencoding' is specified, HTML parsing will be performed with the
4.34 - document encoding assumed to that specified.
4.35 + document encoding assumed to be that specified.
4.36
4.37 If the optional 'unfinished' parameter is set to a true value, unfinished
4.38 documents will be parsed, even though such documents may be missing content
4.39 @@ -742,7 +742,7 @@
4.40 If the optional 'html' parameter is set to a true value, the content to be
4.41 parsed will be treated as being HTML rather than XML. If the optional
4.42 'htmlencoding' is specified, HTML parsing will be performed with the
4.43 - document encoding assumed to that specified.
4.44 + document encoding assumed to be that specified.
4.45
4.46 If the optional 'unfinished' parameter is set to a true value, unfinished
4.47 documents will be parsed, even though such documents may be missing content
4.48 @@ -771,7 +771,7 @@
4.49 If the optional 'html' parameter is set to a true value, the content to be
4.50 parsed will be treated as being HTML rather than XML. If the optional
4.51 'htmlencoding' is specified, HTML parsing will be performed with the
4.52 - document encoding assumed to that specified.
4.53 + document encoding assumed to be that specified.
4.54
4.55 If the optional 'unfinished' parameter is set to a true value, unfinished
4.56 documents will be parsed, even though such documents may be missing content
4.57 @@ -800,7 +800,7 @@
4.58 If the optional 'html' parameter is set to a true value, the content to be
4.59 parsed will be treated as being HTML rather than XML. If the optional
4.60 'htmlencoding' is specified, HTML parsing will be performed with the
4.61 - document encoding assumed to that specified.
4.62 + document encoding assumed to be that specified.
4.63
4.64 If the optional 'unfinished' parameter is set to a true value, unfinished
4.65 documents will be parsed, even though such documents may be missing content
4.66 @@ -814,9 +814,10 @@
4.67 documents.
4.68
4.69 XML documents are retrieved using libxml2's own network capabilities; HTML
4.70 - documents are retrieved using the urllib module provided by Python. To
4.71 + documents are retrieved using the urllib2 module provided by Python. To
4.72 retrieve either kind of document using Python's own modules for this purpose
4.73 - (such as urllib), open a stream and pass it to the parse function:
4.74 + (such as urllib or urllib2), open a stream and pass it to the parse
4.75 + function:
4.76
4.77 f = urllib.urlopen(uri)
4.78 try:
4.79 @@ -828,16 +829,17 @@
4.80 """
4.81
4.82 if html:
4.83 - f = urllib.urlopen(uri)
4.84 + f = urllib2.urlopen(uri)
4.85 try:
4.86 + htmlencoding = f.headers.get("content-type", htmlencoding)
4.87 return parse(f, html=html, htmlencoding=htmlencoding, unfinished=unfinished,
4.88 validate=validate, remote=remote, impl=impl)
4.89 finally:
4.90 f.close()
4.91 else:
4.92 impl = impl or default_impl
4.93 - return impl.adoptDocument(Node_parseURI(uri, html=html, htmlencoding=htmlencoding,
4.94 - unfinished=unfinished, validate=validate, remote=remote))
4.95 + return impl.adoptDocument(Node_parseURI(uri, unfinished=unfinished,
4.96 + validate=validate, remote=remote))
4.97
4.98 def toString(node, encoding=None, prettyprint=0):
4.99
5.1 --- a/libxml2dom/macrolib/__init__.py Sun Jan 29 00:36:39 2012 +0100
5.2 +++ b/libxml2dom/macrolib/__init__.py Sat Jun 01 17:01:05 2013 +0200
5.3 @@ -3,7 +3,7 @@
5.4 """
5.5 DOM macro library for libxml2.
5.6
5.7 -Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Paul Boddie <paul@boddie.org.uk>
5.8 +Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Paul Boddie <paul@boddie.org.uk>
5.9
5.10 This program is free software; you can redistribute it and/or modify it under
5.11 the terms of the GNU Lesser General Public License as published by the Free
5.12 @@ -19,7 +19,7 @@
5.13 with this program. If not, see <http://www.gnu.org/licenses/>.
5.14 """
5.15
5.16 -__version__ = "0.5"
5.17 +__version__ = "0.5.1"
5.18
5.19 # Expose all functions here.
5.20
6.1 --- a/setup.py Sun Jan 29 00:36:39 2012 +0100
6.2 +++ b/setup.py Sat Jun 01 17:01:05 2013 +0200
6.3 @@ -8,7 +8,7 @@
6.4 author = "Paul Boddie",
6.5 author_email = "paul@boddie.org.uk",
6.6 url = "http://www.boddie.org.uk/python/libxml2dom.html",
6.7 - version = "0.5",
6.8 + version = "0.5.1",
6.9 packages = ["libxml2dom", "libxml2dom.macrolib"],
6.10 scripts = ["tools/libxml2macro.py"]
6.11 )