File indexing completed on 2024-04-28 15:54:00

0001 #!/usr/bin/env python2.7
0002 # -*- coding: utf-8 -*-
0003 """:synopsis: support for importing Python modules from ZIP archives.
0004 """
0005 class zipimporter:
0006 
0007 
0008     """
0009     Create a new zipimporter instance. *archivepath* must be a path to a ZIP
0010     file, or to a specific path within a ZIP file.  For example, an *archivepath*
0011     of :file:`foo/bar.zip/lib` will look for modules in the :file:`lib` directory
0012     inside the ZIP file :file:`foo/bar.zip` (provided that it exists).
0013     
0014     :exc:`ZipImportError` is raised if *archivepath* doesn't point to a valid ZIP
0015     archive.
0016     
0017     """
0018     
0019     
0020     def __init__(self, ):
0021         pass
0022     
0023     def find_module(self, fullname,path):
0024         """
0025         Search for a module specified by *fullname*. *fullname* must be the fully
0026         qualified (dotted) module name. It returns the zipimporter instance itself
0027         if the module was found, or :const:`None` if it wasn't. The optional
0028         *path* argument is ignored---it's there for compatibility with the
0029         importer protocol.
0030         
0031         
0032         """
0033         pass
0034         
0035     def get_code(self, fullname):
0036         """
0037         Return the code object for the specified module. Raise
0038         :exc:`ZipImportError` if the module couldn't be found.
0039         
0040         
0041         """
0042         pass
0043         
0044     def get_data(self, pathname):
0045         """
0046         Return the data associated with *pathname*. Raise :exc:`IOError` if the
0047         file wasn't found.
0048         
0049         
0050         """
0051         pass
0052         
0053     def get_filename(self, fullname):
0054         """
0055         Return the value ``__file__`` would be set to if the specified module
0056         was imported. Raise :exc:`ZipImportError` if the module couldn't be
0057         found.
0058         
0059         """
0060         pass
0061         
0062     def get_source(self, fullname):
0063         """
0064         Return the source code for the specified module. Raise
0065         :exc:`ZipImportError` if the module couldn't be found, return
0066         :const:`None` if the archive does contain the module, but has no source
0067         for it.
0068         
0069         
0070         """
0071         pass
0072         
0073     def is_package(self, fullname):
0074         """
0075         Return True if the module specified by *fullname* is a package. Raise
0076         :exc:`ZipImportError` if the module couldn't be found.
0077         
0078         
0079         """
0080         pass
0081         
0082     def load_module(self, fullname):
0083         """
0084         Load the module specified by *fullname*. *fullname* must be the fully
0085         qualified (dotted) module name. It returns the imported module, or raises
0086         :exc:`ZipImportError` if it wasn't found.
0087         
0088         
0089         """
0090         pass
0091         
0092     
0093 
0094