Re: ElementTree and proper identation?

2006-09-27 Thread Robert Kern
John Salerno wrote: > John Salerno wrote: >> Yeah, actually I just gave this a try but I couldn't figure out where >> the code needed to go or how to call the function. I tried creating an >> Element with a few SubElements, then I did: >> >> print >> filename, indent(root) >> >> But that only wr

Re: ElementTree and proper identation?

2006-09-27 Thread John Salerno
John Salerno wrote: > Ok, I see that indent() returns None. In that case, how do I get the > formatted text that it produces? Ok, through the magic of sight I noticed that it is an inplace change, so I tried indent(root) and then wrote root to a file with ElementTree as normal. Very nice! --

Re: ElementTree and proper identation?

2006-09-27 Thread John Salerno
John Salerno wrote: > Fredrik Lundh wrote: >> John Salerno wrote: >> >>> Well, further research reveals that this function isn't available yet >>> in any version. >> >> what keeps you from using the source code on the page you're talking >> about ? >> >> >> > > Yeah, actually I just gave this a

Re: ElementTree and proper identation?

2006-09-27 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >> Well, further research reveals that this function isn't available yet >> in any version. > > what keeps you from using the source code on the page you're talking > about ? > > > Yeah, actually I just gave this a try but I couldn't figure out w

Re: ElementTree and proper identation?

2006-09-27 Thread Wade Leftwich
John Salerno wrote: > John Salerno wrote: > > I've been doing a little studying of ElementTree and it doesn't seem > > very satisfactory for writing XML files that are properly > > formatted/indented. I saw on the website that there is an > > indent/prettyprint function, but this isn't listed in th

Re: ElementTree and proper identation?

2006-09-27 Thread Sébastien Boisgérault
John Salerno a écrit : > I've been doing a little studying of ElementTree and it doesn't seem > very satisfactory for writing XML files that are properly > formatted/indented. I saw on the website that there is an > indent/prettyprint function, but this isn't listed in the Python docs > and I did

Re: ElementTree and proper identation?

2006-09-27 Thread Fredrik Lundh
John Salerno wrote: > Well, further research reveals that this function isn't available yet in > any version. what keeps you from using the source code on the page you're talking about ? -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree and proper identation?

2006-09-27 Thread John Salerno
John Salerno wrote: > I've been doing a little studying of ElementTree and it doesn't seem > very satisfactory for writing XML files that are properly > formatted/indented. I saw on the website that there is an > indent/prettyprint function, but this isn't listed in the Python docs > and I didn

ElementTree and proper identation?

2006-09-27 Thread John Salerno
I've been doing a little studying of ElementTree and it doesn't seem very satisfactory for writing XML files that are properly formatted/indented. I saw on the website that there is an indent/prettyprint function, but this isn't listed in the Python docs and I didn't see it after doing a dir(),