Ever heard of Gogh? This is a really nice drawing tool for graphic tablets owner (such as those by Wacom). However it stopped working on my Hardy system after some recent update. After some investigation, it appeared that it was due to python-xml being moved away of Python path because it interfered with stuff in Python core ; the whole python-xml package being scheduled for deprecation as soon as the reverse depends would be cleared. I figured it out and dropped the reference to python-xml package in gogh/settingsmanager.py, using a method provided by Python core xml stuff instead. It seems that quite a bunch of people are currently using xml.doc.ext.PrettyPrint from pyxml to output an XML document to a file, so I figured that posting this little tip might help someone
So, let’s say you currently have something like this to output your xml document “doc” to a file at path “path”, doc being an xml.dom.minidom.Document object (or similar):
f = open(path, "w")
xml.dom.ext.PrettyPrint(doc, f)
f.close()
All you need to change is PrettyPrint call to make use of the .toxml() method of your document object instead:
f = open(path, "w")
f.write(doc.toxml())
f.close()
Here you go, hope this might save someone’s day someday
April 28th, 2008 at 8:33 pm
This same trick fixes GRC (GnuRadio Companion) also. Thanks!
June 3rd, 2008 at 10:55 pm
“Here you go, hope this might save someone’s day someday.”
Sure saved my day, thanks a bunch!
July 4th, 2008 at 12:40 am
yeahh menn omG
this saved my day after 2 hours of looking for something
thannk you very muuch dude
September 24th, 2008 at 9:12 pm
I was having trouble getting Gogh/PyXML working, but this fixed it without having to go through all the usual yak-shaving and chasing dependencies.
Thank You!!!