[Lxml-checkins] r51189 - in lxml/trunk: . doc src/lxml
scoder at codespeak.net
scoder at codespeak.net
Fri Feb 1 16:26:16 CET 2008
Author: scoder
Date: Fri Feb 1 16:26:15 2008
New Revision: 51189
Modified:
lxml/trunk/ (props changed)
lxml/trunk/doc/lxml2.txt
lxml/trunk/src/lxml/xmlerror.pxi
Log:
r3395 at delle: sbehnel | 2008-02-01 16:25:37 +0100
cleanup in deprecated functions, say what will be removed in lxml 2.1
Modified: lxml/trunk/doc/lxml2.txt
==============================================================================
--- lxml/trunk/doc/lxml2.txt (original)
+++ lxml/trunk/doc/lxml2.txt Fri Feb 1 16:26:15 2008
@@ -7,11 +7,11 @@
1 Changes in etree and objectify
1.1 Incompatible changes
1.2 Enhancements
- 1.3 Deprecated features
+ 1.3 Deprecation
2 New modules
- 2.1 lxml.html
- 2.2 lxml.cssselect
- 2.3 lxml.doctestcompare
+ 2.1 lxml.usedoctest
+ 2.2 lxml.html
+ 2.3 lxml.cssselect
During the development of the lxml 1.x series, a couple of quirks were
@@ -147,12 +147,32 @@
.. _`TreeBuilder interface`: http://effbot.org/elementtree/elementtree-treebuilder.htm
-Deprecated features
--------------------
+Deprecation
+-----------
-The following features were deprecated and will be removed in lxml 2.1:
+The following functions and methods were deprecated and will be
+removed in lxml 2.1:
-* The ``tounicode()`` function was replaced by ``tostring(encoding=unicode)``.
+* The ``tounicode()`` function was replaced by the call
+ ``tostring(encoding=unicode)``.
+
+* CamelCaseNamed module functions were renamed to their underscore
+ equivalents to follow `PEP 8`_ in naming.
+
+ - ``etree.setDefaultParser()`` -> ``etree.set_default_parser()``
+
+ - ``etree.getDefaultParser()`` -> ``etree.get_default_parser()``
+
+ - ``etree.useGlobalPythonLog()`` -> ``etree.use_global_python_log()``
+
+ - ``XMLParser.setElementClassLookup()`` -> ``.set_element_class_lookup()``
+
+ - ``HTMLParser.setElementClassLookup()`` -> ``.set_element_class_lookup()``
+
+* The ``.getiterator()`` method on Elements and ElementTrees was
+ renamed to ``.iter()`` to follow ElementTree 1.3.
+
+.. _`PEP 8`: http://www.python.org/dev/peps/pep-0008/
New modules
Modified: lxml/trunk/src/lxml/xmlerror.pxi
==============================================================================
--- lxml/trunk/src/lxml/xmlerror.pxi (original)
+++ lxml/trunk/src/lxml/xmlerror.pxi Fri Feb 1 16:26:15 2008
@@ -4,9 +4,17 @@
# module level API functions
+def clear_error_log():
+ """Clear the global error log. Note that this log is already bound to a
+ fixed size.
+ """
+ __GLOBAL_ERROR_LOG.clear()
+
def clearErrorLog():
"""Clear the global error log. Note that this log is already bound to a
fixed size.
+
+ @deprecated: use ``clear_error_log()`` instead.
"""
__GLOBAL_ERROR_LOG.clear()
@@ -386,6 +394,17 @@
Note that this disables access to the global error log from exceptions.
Parsers, XSLT etc. will continue to provide their normal local error log.
+
+ @deprecated: use ``use_global_python_log()`` instead.
+ """
+ use_global_python_log(log)
+
+def use_global_python_log(PyErrorLog log not None):
+ """Replace the global error log by an etree.PyErrorLog that uses the
+ standard Python logging package.
+
+ Note that this disables access to the global error log from exceptions.
+ Parsers, XSLT etc. will continue to provide their normal local error log.
"""
global __GLOBAL_ERROR_LOG
__GLOBAL_ERROR_LOG = log
More information about the lxml-checkins
mailing list