Module zipfile :: Class PyZipFile
[hide private]
[frames] | no frames]

_ClassType PyZipFile

ZipFile --+
          |
         PyZipFile

Class to create ZIP archives with Python library files and packages.

Instance Methods [hide private]
 
writepy(self, pathname, basename='')
Add all files from "pathname" to the ZIP archive.
 
_get_codename(self, pathname, basename)
Return (filename, archivename) for the path.

Inherited from ZipFile: __del__, __init__, close, getinfo, infolist, namelist, printdir, read, testzip, write, writestr

Inherited from ZipFile (private): _GetContents, _RealGetContents, _writecheck

Class Variables [hide private]

Inherited from ZipFile: fp

Method Details [hide private]

writepy(self, pathname, basename='')

 

Add all files from "pathname" to the ZIP archive.

If pathname is a package directory, search the directory and all package subdirectories recursively for all *.py and enter the modules into the archive. If pathname is a plain directory, listdir *.py and enter all modules. Else, pathname must be a Python *.py file and the module will be put into the archive. Added modules are always module.pyo or module.pyc. This method will compile the module.py into module.pyc if necessary.

_get_codename(self, pathname, basename)

 

Return (filename, archivename) for the path.

Given a module name path, return the correct file path and archive name, compiling if necessary. For example, given /python/lib/string, return (/python/lib/string.pyc, string).