Skip to content

Commit

Permalink
[svn r3242] r3395@delle: sbehnel | 2008-02-01 16:25:37 +0100
Browse files Browse the repository at this point in the history
 cleanup in deprecated functions, say what will be removed in lxml 2.1

--HG--
branch : trunk
  • Loading branch information
scoder committed Feb 1, 2008
1 parent c524a06 commit 75d2528
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
36 changes: 28 additions & 8 deletions doc/lxml2.txt
Expand Up @@ -7,11 +7,11 @@ What's new in lxml 2.0?
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
Expand Down Expand Up @@ -147,12 +147,32 @@ features.
.. _`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
Expand Down
19 changes: 19 additions & 0 deletions src/lxml/xmlerror.pxi
Expand Up @@ -4,9 +4,17 @@ cimport xmlerror

# 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()

Expand Down Expand Up @@ -384,6 +392,17 @@ def useGlobalPythonLog(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.
@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.
"""
Expand Down

0 comments on commit 75d2528

Please sign in to comment.