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 or 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;

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.