Opening and Saving Files made easier.
I implemented a (hopefully) reasonable open/save logic, supporting encryption, compression, ( and encrypted compression ;-) atomic saves.
Since almost every app can use this, why not make it a module?
Using rotor is kind of a cruel joke :) I believe they're getting rid of all encryption algorithms from the Python 2.4 core anyways, just to avoid legal hassle. I would just rip that out and support optional crypto by other means (PyCrypto, for example).
Why the choice of ".comp" instead of the standard .gz?
Well, I can rip it off and just stick rijndael instead, since there is a pure-python public domain version.
The .comp is because gunzip can't uncompress it :-)
It was uncompressible if I used the gzipfile stuff, but that meant compression was always done at the end, and for encrypted stuff it made *larger* files :-)
Erm... when I said "it was uncompressible" I meant "gzip could uncompress it". The concept per word density just got out of hand there :-)
Yes, of course, gzip can't uncompress a raw zlib encoded file. The gzipfile module probably just sucks, then. I've done streaming implementations of gzip that work just fine.
It's not that gzipfile sucks, it's just what it does: it's a transparent file object, but stores gzipped. So by definition gzipping is the last thing before storage.
Do you have those streaming gzip imps available somewhere?
http://undefined.org/python/twisted_gzstream.tgz is an implementation geared towards usage in a Twisted protocol, but the actual gzip part of it doesn't have much to do with Twisted.