| |
- __builtin__.object
-
- zipimporter
- exceptions.ImportError(exceptions.StandardError)
-
- ZipImportError
class zipimporter(__builtin__.object) |
|
zipimporter(archivepath) -> zipimporter object
Create a new zipimporter instance. 'archivepath' must be a path to
a zipfile, or to a specific path inside a zipfile. For example, it can be
'/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
valid directory inside the archive.
'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
archive.
The 'archive' attribute of zipimporter objects contains the name of the
zipfile targeted. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __repr__(...)
- x.__repr__() <==> repr(x)
- find_module(...)
- find_module(fullname, path=None) -> self or None.
Search for a module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the zipimporter
instance itself if the module was found, or None if it wasn't.
The optional 'path' argument is ignored -- it's there for compatibility
with the importer protocol.
- get_code(...)
- get_code(fullname) -> code object.
Return the code object for the specified module. Raise ZipImportError
if the module couldn't be found.
- get_data(...)
- get_data(pathname) -> string with file data.
Return the data associated with 'pathname'. Raise IOError if
the file wasn't found.
- get_filename(...)
- get_filename(fullname) -> filename string.
Return the filename for the specified module.
- get_source(...)
- get_source(fullname) -> source string.
Return the source code for the specified module. Raise ZipImportError
if the module couldn't be found, return None if the archive does
contain the module, but has no source for it.
- is_package(...)
- is_package(fullname) -> bool.
Return True if the module specified by fullname is a package.
Raise ZipImportError if the module couldn't be found.
- load_module(...)
- load_module(fullname) -> module.
Load the module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the imported
module, or raises ZipImportError if it wasn't found.
Data descriptors defined here:
- archive
- prefix
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |