Cleanup the docs ElementTree a bit.

This commit is contained in:
Serhiy Storchaka 2013-01-13 22:24:27 +02:00
commit 9e189f0a28
2 changed files with 14 additions and 14 deletions

View File

@ -428,7 +428,7 @@ Functions
arguments. Returns an element instance. arguments. Returns an element instance.
.. function:: tostring(element, encoding="us-ascii", method="xml", *,\ .. function:: tostring(element, encoding="us-ascii", method="xml", *, \
short_empty_elements=True) short_empty_elements=True)
Generates a string representation of an XML element, including all Generates a string representation of an XML element, including all
@ -443,7 +443,7 @@ Functions
The *short_empty_elements* parameter. The *short_empty_elements* parameter.
.. function:: tostringlist(element, encoding="us-ascii", method="xml", *,\ .. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \
short_empty_elements=True) short_empty_elements=True)
Generates a string representation of an XML element, including all Generates a string representation of an XML element, including all
@ -751,8 +751,8 @@ ElementTree Objects
section root element. section root element.
.. method:: write(file, encoding="us-ascii", xml_declaration=None,\ .. method:: write(file, encoding="us-ascii", xml_declaration=None, \
default_namespace=None, method="xml", *,\ default_namespace=None, method="xml", *, \
short_empty_elements=True) short_empty_elements=True)
Writes the element tree to a file, as XML. *file* is a file name, or a Writes the element tree to a file, as XML. *file* is a file name, or a
@ -761,9 +761,9 @@ ElementTree Objects
*xml_declaration* controls if an XML declaration should be added to the *xml_declaration* controls if an XML declaration should be added to the
file. Use ``False`` for never, ``True`` for always, ``None`` file. Use ``False`` for never, ``True`` for always, ``None``
for only if not US-ASCII or UTF-8 or Unicode (default is ``None``). for only if not US-ASCII or UTF-8 or Unicode (default is ``None``).
*default_namespace* sets the default XML namespace (for "xmlns").
*method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is
``"xml"``). *default_namespace* sets the default XML namespace (for ``"xml"``).
"xmlns").
The keyword-only *short_empty_elements* parameter controls the formatting The keyword-only *short_empty_elements* parameter controls the formatting
of elements that contain no content. If *True* (the default), they are of elements that contain no content. If *True* (the default), they are
emitted as a single self-closed tag, otherwise they are emitted as a pair emitted as a single self-closed tag, otherwise they are emitted as a pair

View File

@ -785,16 +785,16 @@ class ElementTree:
default_namespace=None, default_namespace=None,
method=None, *, method=None, *,
short_empty_elements=True): short_empty_elements=True):
"""Write the element tree to a file, as XML. 'file_or_filename' is a """Write the element tree to a file, as XML. 'file_or_filename' is a
file name or a file object opened for writing. 'encoding' is the file name or a file object opened for writing.
output encoding (default is US-ASCII). 'xml_declaration' controls 'encoding' is the output encoding (default is US-ASCII).
if an XML declaration should be added to the output. Use False 'xml_declaration' controls if an XML declaration should be added
for never, True for always, None for only if not US-ASCII or to the output. Use False for never, True for always, None for only
UTF-8 or Unicode (default is None). 'method' is either "xml" if not US-ASCII or UTF-8 or Unicode (default is None).
(default), "html", "text" or "c14n".
'default_namespace' sets the default XML namespace (for "xmlns"). 'default_namespace' sets the default XML namespace (for "xmlns").
'method' is either "xml" (default), "html", "text" or "c14n".
The keyword-only 'short_empty_elements' parameter controls the The keyword-only 'short_empty_elements' parameter controls the
formatting of elements that contain no content. If True (default), formatting of elements that contain no content. If True (default),
they are emitted as a single self-closed tag, otherwise they are they are emitted as a single self-closed tag, otherwise they are
emitted as a pair of start/end tags. emitted as a pair of start/end tags.