[Python-Dev] Zipping Zope3

Moore, Paul Paul.Moore@atosorigin.com
Thu, 19 Dec 2002 09:22:37 -0000


From: Just van Rossum [mailto:just@letterror.com]
> Btw. what you want is _possible_ with the current zipimporter
> object: there's zi.get_data(filename), and you can inspect the
> "files" attribute (a dict mapping filenames to index info; it's
> an internal attribute, so I might rename it to _files).

Just to clarify this point: you can subclass the existing
zipimport.zipimporter class and add any extra methods you want.
Then, by replacing zipimporter in sys.path_hooks with your
subclass, you transparently get your extra functionality.

I'm not saying that this is the ultimate solution, but it gives
us an opportunity to experiment before committing to a specific
implementation in the core.

Paul.