Saturday, June 2, 2007

Fun with the testsuite...

Well I wasn't able to do a lot of work on KWord recently : my KDE4 copy broke totally, I had to build it again from scratch...
But now I can continue my fun work : playing with the ODF testsuite. This testsuite is extremely interesting : its files are quite small, testing one feature totally...
Really good.
But some test cases are broken. For instance, no suite should be able to pass the font size test case totally except openoffice because the file isn't valid regarding the spec (there is no "Default" style defined in the spec, and it's mentionned in the file but not defined).
A problem with manipulating ODF files such as these : you must unzip them, then you can open each XML file in KWrite.. That's quite boring. I just wrote a ~20 lines Q&D python program (Quick and Dirty) to help me with this. It's showing on the left the file list, and on the right it shows the file, in raw text. Fast and simple. Now, I can just drop an ODF file from konqueror to the icon on my desktop and voila.
Mandatory screenshot : http://www.pinaraf.info/ODF_viewer.png
The source code (using Python + PyQt4) : http://www.pinaraf.info/ODF_explorer.tar.bz2
If you consider this small piece of code usefull or a good idea or a "should be improved" thing... send my an email or post a comment. I don't plan to extend it really, it's doing its job for me, I don't need more... but if you want more, perhaps you'll get more :)

That's all folks...



P.S : I upgraded this small python thing : now it's automatically pretty-printing the ODF files, and there is some basic coloration of the XML file... Far far better :)

No comments: