App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.dist.py_zipimport.zipimporter Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def find_module
 
def load_module
 
def get_data
 
def is_package
 
def get_code
 
def get_source
 

Public Attributes

 archive
 
 prefix
 
 zipfile
 

Detailed Description

A PEP-302-style importer that can import from a zipfile.

Just insert or append this class (not an instance) to sys.path_hooks
and you're in business.  Instances satisfy both the 'importer' and
'loader' APIs specified in PEP 302.

Constructor & Destructor Documentation

def google.appengine.dist.py_zipimport.zipimporter.__init__ (   self,
  path_entry 
)
Constructor.

Args:
  path_entry: The entry in sys.path.  This should be the name of an
existing zipfile possibly with a path separator and a prefix
path within the archive appended, e.g. /x/django.zip or
/x/django.zip/foo/bar.

Raises:
  ZipImportError if the path_entry does not represent a valid
  zipfile with optional prefix.

Member Function Documentation

def google.appengine.dist.py_zipimport.zipimporter.__repr__ (   self)
Return a string representation matching zipimport.c.
def google.appengine.dist.py_zipimport.zipimporter.find_module (   self,
  fullmodname,
  path = None 
)
PEP-302-compliant find_module() method.

Args:
  fullmodname: The dot-separated full module name, e.g. 'django.core.mail'.
  path: Optional and ignored; present for API compatibility only.

Returns:
  None if the module isn't found in the archive; self if it is found.
def google.appengine.dist.py_zipimport.zipimporter.get_code (   self,
  fullmodname 
)
Return bytecode for a module.
def google.appengine.dist.py_zipimport.zipimporter.get_data (   self,
  fullpath 
)
Return (binary) content of a data file in the zipfile.
def google.appengine.dist.py_zipimport.zipimporter.get_source (   self,
  fullmodname 
)
Return source code for a module.
def google.appengine.dist.py_zipimport.zipimporter.is_package (   self,
  fullmodname 
)
Return whether a module is a package.
def google.appengine.dist.py_zipimport.zipimporter.load_module (   self,
  fullmodname 
)
PEP-302-compliant load_module() method.

Args:
  fullmodname: The dot-separated full module name, e.g. 'django.core.mail'.

Returns:
  The module object constructed from the source code.

Raises:
  SyntaxError if the module's source code is syntactically incorrect.
  ImportError if there was a problem accessing the source code.
  Whatever else can be raised by executing the module's source code.

The documentation for this class was generated from the following file: