how does PackageArchive work?

It looks like this can read form archives (multi files) and load python code form them using the import hook. How exactly does this work?

I was thinking on writing a panda3d player. A player that takes .mf files and loads code inside of them and runs it probably the main.py or init.py. The player files should have a simple to use compiler to distribute them.

The main reason why I want to do it this way is that mf files can be encrypted , compressed and patched. Distributing them also pretty easy. Maybe more advanced things such as sand boxing and ActiveX/firefox plugin can be considered.

Not sure if this is what you mean but found this x.x; pypi.python.org/pypi/pypicache/0.2

This is certainly doable. Python allows you to replace the implementation of import with a function of your own design.

There is already a tool–try googling SqueezeTool–that does this for zip files. It wouldn’t be hard to extend it or use the same concept to do the same thing for .mf files.

David