| Modifier and Type | Class and Description |
|---|---|
| private class | zipimporter.
ZipBundle is a ZipFile and one of its InputStreams, bundled together so the ZipFile can be closed when finished with its InputStream. |
| Modifier and Type | Field and Description |
|---|---|
| public static final PyString | |
| public String | archive
Path to the Zip archive |
| public PyObject | files
Dict with file info {path: tocEntry} |
| private static Logger | |
| public String | prefix
File prefix: "a/sub/directory/" |
| private PySystemState | sys
The PySystemState this zipimporter is associated with |
| public static final PyType |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private long | Returns: a long time (in milliseconds) valuea dos style timestamp (only time) integer dosTime, int a dos style date integer dosDate)Convert the date/time values found in the Zip archive to a long time (in milliseconds) value. |
| private int | Returns: an int, dos style date valuein milliseconds, a long value time)Convert a time in milliseconds since epoch to DOS date format |
| private int | Returns: an int, dos style time valuein milliseconds, a long value time)Convert a time in milliseconds since epoch to DOS time format |
| public PyObject | |
| public PyObject | Returns: a loader instance if this importer can load the module, None otherwisethe fully qualified name of the module fullname, String if not installed on the meta-path None or a module path path)Find the module for the fully qualified name. |
| public PyObject | |
| public String | Returns: a String of data in binary mode (no CRLF)a String path name within the archive path)Implements abstract org. Return the uncompressed data for the file at the specified path as bytes. |
| public PyObject | |
| public String | Returns: a String of the module's source code or nullthe fully qualified name of the module fullname)Return the source code for the module as a string (using newline characters for line endings) |
| public PyString | |
| protected String | getSeparator()
Implements abstract org. Returns the separator between directories and files used by this type of importer. |
| protected long | getSourceMtime(String
to the compiled file path)Implements abstract org. Given a path to a compiled file in the archive, return the modification time of the matching .py file. |
| protected String | Returns: a split(".")[-1] String valuea String value fullname)Return fullname.split(".")[-1]. |
| public boolean | Returns: a boolean describing if the module is a packagethe fully qualified name of the module fullname)Return a boolean signifying whether the module is a package or not. |
| public PyObject | Returns: a loaded PyModulethe fully qualified name of the module fullname)Load a module for the fully qualified name. |
| public zipimporter. | Returns: a ZipBundle with an InputStream to the file's uncompressed datafile's filename inside of the archive datapath, PyObject entry)Implements abstract org. Given a path to a compressed file in the archive, return the file's (uncompressed) data stream in a ZipBundle. |
| protected PyObject | makeEntry(String fullFilename)
Implements abstract org. Returns an entry for a filename from makeFilename with a potential suffix such that this importer can make a bundle with it, or null if fullFilename doesn't exist in this importer. |
| protected String | makeFilename(String fullname)
Implements abstract org. Given a full module name, return the potential file path in the archive (without extension). |
| protected String | makeFilePath(String fullname)
Implements abstract org. Given a full module name, return the potential file path including the archive (without extension). |
| protected String | makePackagePath(String fullname)
Implements abstract org. Returns the value to fill in __path__ on a module with the given full module name created by this importer. |
| private PyObject | Returns: a PyDictionary of tocEntrysPyString path to the archive archive)readDirectory(archive) -> files dict (new reference) Given a path to a Zip archive, build a dict, mapping file names (local to the archive, using SEP as a separator) to toc entries. |
| private void | readZipFile(ZipFile
ZipFile to read zipFile, PyObject a dict-like PyObject files)Read ZipFile metadata into a dict of toc entries. |
| public boolean | refersDirectlyTo(PyObject ob)
Implements org. Optional operation. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| public int | traverse(Visitproc visit, Object arg)
Implements org. Traverses all directly contained |
| pack-priv final void | |
| private void | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final String | |
| pack-priv final PyObject | |
| pack-priv final String | |
| pack-priv final boolean | |
| pack-priv final PyObject | |
| pack-priv final String |
| __doc__ | back to summary |
|---|---|
| public static final PyString __doc__
| |
| archive | back to summary |
|---|---|
| public String archive Path to the Zip archive | |
| files | back to summary |
|---|---|
| public PyObject files Dict with file info {path: tocEntry}
| |
| log | back to summary |
|---|---|
| private static Logger log | |
| prefix | back to summary |
|---|---|
| public String prefix File prefix: "a/sub/directory/" | |
| sys | back to summary |
|---|---|
| private PySystemState sys The PySystemState this zipimporter is associated with | |
| TYPE | back to summary |
|---|---|
| public static final PyType TYPE | |
| zipimporter | back to summary |
|---|---|
| public zipimporter() | |
| zipimporter | back to summary |
|---|---|
| public zipimporter(PyType subType) | |
| zipimporter | back to summary |
|---|---|
| public zipimporter(String path) | |
| dosTimeToEpoch | back to summary |
|---|---|
| private long dosTimeToEpoch(int dosTime, int dosDate) Convert the date/time values found in the Zip archive to a long time (in milliseconds) value.
a long time (in milliseconds) value
| |
| epochToDosDate | back to summary |
|---|---|
| private int epochToDosDate(long time) Convert a time in milliseconds since epoch to DOS date format
| |
| epochToDosTime | back to summary |
|---|---|
| private int epochToDosTime(long time) Convert a time in milliseconds since epoch to DOS time format
| |
| find_module | back to summary |
|---|---|
| public PyObject find_module(String fullname) | |
| find_module | back to summary |
|---|---|
| public PyObject find_module(String fullname, String path) Find the module for the fully qualified name.
a loader instance if this importer can load the module, None otherwise | |
| get_code | back to summary |
|---|---|
| public PyObject get_code(String fullname) Return the code object associated with the module. | |
| get_data | back to summary |
|---|---|
| public String get_data(String path) Implements abstract org. Return the uncompressed data for the file at the specified path as bytes. | |
| get_filename | back to summary |
|---|---|
| public PyObject get_filename(String fullname) | |
| get_source | back to summary |
|---|---|
| public String get_source(String fullname) Return the source code for the module as a string (using newline characters for line endings) | |
| getArchive | back to summary |
|---|---|
| public PyString getArchive() Path to the Zip archive as FS-encoded
| |
| getSeparator | back to summary |
|---|---|
| protected String getSeparator() Implements abstract org. Doc from org. Returns the separator between directories and files used by this type of importer.
| |
| getSourceMtime | back to summary |
|---|---|
| protected long getSourceMtime(String path) Implements abstract org. Doc from org. Given a path to a compiled file in the archive, return the modification time of the matching .py file. | |
| getSubname | back to summary |
|---|---|
| protected String getSubname(String fullname) Return fullname.split(".")[-1]. | |
| is_package | back to summary |
|---|---|
| public boolean is_package(String fullname) Return a boolean signifying whether the module is a package or not.
| |
| load_module | back to summary |
|---|---|
| public PyObject load_module(String fullname) Load a module for the fully qualified name. | |
| makeBundle | back to summary |
|---|---|
| public zipimporter. Implements abstract org. Given a path to a compressed file in the archive, return the file's (uncompressed) data stream in a ZipBundle.
| |
| makeEntry | back to summary |
|---|---|
| protected PyObject makeEntry(String fullFilename) Implements abstract org. Doc from org. Returns an entry for a filename from makeFilename with a potential suffix such that this importer can make a bundle with it, or null if fullFilename doesn't exist in this importer.
| |
| makeFilename | back to summary |
|---|---|
| protected String makeFilename(String fullname) Implements abstract org. Doc from org. Given a full module name, return the potential file path in the archive (without extension).
| |
| makeFilePath | back to summary |
|---|---|
| protected String makeFilePath(String fullname) Implements abstract org. Doc from org. Given a full module name, return the potential file path including the archive (without extension).
| |
| makePackagePath | back to summary |
|---|---|
| protected String makePackagePath(String fullname) Implements abstract org. Doc from org. Returns the value to fill in __path__ on a module with the given full module name created by this importer.
| |
| readDirectory | back to summary |
|---|---|
| private PyObject readDirectory(String archive) readDirectory(archive) -> files dict (new reference) Given a path to a Zip archive, build a dict, mapping file names (local to the archive, using SEP as a separator) to toc entries.
| |
| readZipFile | back to summary |
|---|---|
| private void readZipFile(ZipFile zipFile, PyObject files) Read ZipFile metadata into a dict of toc entries. A tocEntry is a tuple: (__file__, # value to use for __file__, available for all files compress, # compression kind; 0 for uncompressed data_size, # size of compressed data on disk file_size, # size of decompressed data file_offset, # offset of file header from start of archive (or -1 in Jython) time, # mod time of file (in dos format) date, # mod data of file (in dos format) crc, # crc checksum of the data ) Directories can be recognized by the trailing SEP in the name, data_size and file_offset are 0. | |
| refersDirectlyTo | back to summary |
|---|---|
| public boolean refersDirectlyTo(PyObject ob) Implements org. Doc from org. Optional operation.
Should only be implemented if it is more efficient
than calling
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| traverse | back to summary |
|---|---|
| public int traverse(Visitproc visit, Object arg) Implements org. Doc from org. Traverses all directly contained
| |
| zipimporter___init__ | back to summary |
|---|---|
pack-priv final void zipimporter___init__(PyObject[] args, String[] kwds)
| |
| zipimporter___init__ | back to summary |
|---|---|
| private void zipimporter___init__(String path) | |
| zipimporter_find_module | back to summary |
|---|---|
pack-priv final PyObject zipimporter_find_module(String fullname, String path)
| |
| zipimporter_get_code | back to summary |
|---|---|
pack-priv final PyObject zipimporter_get_code(String fullname)
| |
| zipimporter_get_data | back to summary |
|---|---|
pack-priv final String zipimporter_get_data(PyObject opath)
| |
| zipimporter_get_filename | back to summary |
|---|---|
pack-priv final PyObject zipimporter_get_filename(String fullname)
| |
| zipimporter_get_source | back to summary |
|---|---|
pack-priv final String zipimporter_get_source(String fullname)
| |
| zipimporter_is_package | back to summary |
|---|---|
pack-priv final boolean zipimporter_is_package(String fullname)
| |
| zipimporter_load_module | back to summary |
|---|---|
pack-priv final PyObject zipimporter_load_module(String fullname)
| |
| zipimporter_toString | back to summary |
|---|---|
pack-priv final String zipimporter_toString()
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ZipFile |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Close the ZipFile; implicitly closes all of its InputStreams. |
| zipFile | back to summary |
|---|---|
| pack-priv ZipFile zipFile | |
| ZipBundle | back to summary |
|---|---|
| public ZipBundle(ZipFile zipFile, InputStream inputStream) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Close the ZipFile; implicitly closes all of its InputStreams. Raises an IOError if a problem occurred.
| |