~ubuntu-branches/ubuntu/saucy/lxml/saucy-updates

« back to all changes in this revision

Viewing changes to src/lxml/lxml.etree.pyx

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-27 22:14:53 UTC
  • mto: (2.1.34 experimental) (1.4.1)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20130127221453-2k7oc1crqc28802y
Tags: upstream-3.1~beta1
ImportĀ upstreamĀ versionĀ 3.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2995
2995
    """
2996
2996
    return isinstance(element, _Element) and (<_Element>element)._c_node is not NULL
2997
2997
 
2998
 
def dump(_Element elem not None, *, bint pretty_print=True, bint with_tail=True):
 
2998
def dump(_Element elem not None, *, bint pretty_print=True, with_tail=True):
2999
2999
    u"""dump(elem, pretty_print=True, with_tail=True)
3000
3000
 
3001
3001
    Writes an element tree or element structure to sys.stdout. This function
3002
3002
    should be used for debugging only.
3003
3003
    """
3004
 
    _assertValidNode(elem)
3005
 
    _dumpToFile(sys.stdout, elem._c_node, pretty_print, with_tail)
 
3004
    xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,
 
3005
                   encoding=u'unicode' if python.IS_PYTHON3 else None)
 
3006
    if not pretty_print:
 
3007
        xml += '\n'
 
3008
    sys.stdout.write(xml)
3006
3009
 
3007
3010
def tostring(element_or_tree, *, encoding=None, method=u"xml",
3008
3011
             xml_declaration=None, bint pretty_print=False, bint with_tail=True,