ElementTree and Tidy
Way back in Part 4, I discussed the fact that I was not able to get ElementTree's build-in Tidy functionality to work for me. It depended on having an executable Tidy command, that it would run via os.system(). Therefore, I switched to M.-A. Lemburg's mxTidy, which used a library-ized version of Tidy. However, using mxTidy lead me down the whole path of needing to create the FileAdapter class so that I could use mxTidy as part of a chain of file-like objects...
Now comes an announcement from Mr. ElementTree himself (the effbot), that the new 1.2 (final) version of ElementTree will use a (different) library-ized version of Tidy, and that the new TidyHTMLTreeBuilder parser will use this version of Tidy to directly build an element tree from HTML. Woot! This will allow me to greatly simplify my appointment-making robot. I will eagerly await the release of ElementTree 1.2 (final).
(Upon further investigation, I discovered that both ElementTree and mxTidy are in fact using the same library-ized version of Dave Raggett's HTML Tidy program.)
3:46:21 PM
|