classification
Title: xml.etree.ElementTree: add feature to prettify XML output
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eli.bendersky, eric.araujo, loewis, santa4nt, tshepang
Priority: normal Keywords:

Created on 2012-04-01 15:28 by tshepang, last changed 2012-04-06 06:24 by eric.araujo.

Messages (5)
msg157299 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2012-04-01 15:28
I often miss lxml's "pretty_print=True" functionality. Can you implement something similar.
msg157317 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-04-01 16:49
Would you like to provide a patch?
msg157320 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-04-01 17:59
Tshepang,

Frankly, there are a lot of issues to solve in ElementTree (it hasn't been given love in a long time...) and such features would be low priority, as I'm not getting much help and am swamped already.

As Martin said, patches can go a long way here...
msg157325 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2012-04-01 19:08
Okay, I will try, even though C scares me.
msg157647 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-04-06 06:24
You may be able to code it entirely in the Python part of the module (adding a new parameter to Element.write and tostring).
History
Date User Action Args
2012-04-06 06:24:10eric.araujosetnosy: + eric.araujo
messages: + msg157647
2012-04-05 22:20:48santa4ntsetnosy: + santa4nt
2012-04-01 19:08:10tshepangsetmessages: + msg157325
2012-04-01 17:59:20eli.benderskysetmessages: + msg157320
2012-04-01 16:49:32loewissetnosy: + loewis
messages: + msg157317
2012-04-01 16:43:46r.david.murraysettype: enhancement
2012-04-01 15:29:13tshepangsettitle: add feature to prettify XML output -> xml.etree.ElementTree: add feature to prettify XML output
2012-04-01 15:28:03tshepangcreate