[Python-checkins] cpython (merge 3.3 -> default): Cleanup the docs ElementTree a bit.

serhiy.storchaka python-checkins at python.org
Sun Jan 13 21:31:53 CET 2013


http://hg.python.org/cpython/rev/50606131a987
changeset: 81494:50606131a987
parent: 81490:f0e80c7404a5
parent: 81493:159276962d16
user: Serhiy Storchaka <storchaka at gmail.com>
date: Sun Jan 13 22:24:27 2013 +0200
summary:
 Cleanup the docs ElementTree a bit.
files:
 Doc/library/xml.etree.elementtree.rst | 12 +++++-----
 Lib/xml/etree/ElementTree.py | 16 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -428,7 +428,7 @@
 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)
 
 Generates a string representation of an XML element, including all
@@ -443,7 +443,7 @@
 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)
 
 Generates a string representation of an XML element, including all
@@ -751,8 +751,8 @@
 section root element.
 
 
- .. method:: write(file, encoding="us-ascii", xml_declaration=None,\
- default_namespace=None, method="xml", *,\
+ .. method:: write(file, encoding="us-ascii", xml_declaration=None, \
+ default_namespace=None, method="xml", *, \
 short_empty_elements=True)
 
 Writes the element tree to a file, as XML. *file* is a file name, or a
@@ -761,9 +761,9 @@
 *xml_declaration* controls if an XML declaration should be added to the
 file. Use ``False`` for never, ``True`` for always, ``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
- ``"xml"``). *default_namespace* sets the default XML namespace (for
- "xmlns").
+ ``"xml"``).
 The keyword-only *short_empty_elements* parameter controls the formatting
 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
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -785,16 +785,16 @@
 default_namespace=None,
 method=None, *,
 short_empty_elements=True):
- """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
- output encoding (default is US-ASCII). 'xml_declaration' controls
- if an XML declaration should be added to the output. Use False
- for never, True for always, None for only if not US-ASCII or
- UTF-8 or Unicode (default is None). 'method' is either "xml"
- (default), "html", "text" or "c14n".
+ """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 output encoding (default is US-ASCII).
+ 'xml_declaration' controls if an XML declaration should be added
+ to the output. Use False for never, True for always, 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" (default), "html", "text" or "c14n".
 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
 emitted as a pair of start/end tags.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /