How to extract/decompress cloop images (python version)

I’m working on a little project to multiboot anything and everything unix in the universe on a single media. This is one of the several utilities that I have written to help with that. It’s a python version of the original decompressor for compressed loopback device (cloop). To extract/decompress the cloop image, you can do:

python cloop-decompress ~/tmp/KNOPPIX ~/tmp/KNOPPIX.raw

Now you can loop mount the raw image as you normally would:

mount -o loop ~/tmp/KNOPPIX.raw /mnt