Module imputil
[hide private]
[frames] | no frames]

Module imputil


Import utilities

Exported classes:
    ImportManager   Manage the import process

    Importer        Base class for replacing standard import functions
    BuiltinImporter Emulate the import mechanism for builtin and frozen modules

    DynLoadSuffixImporter

Classes [hide private]
ImportManager
Manage the import process.
Importer
Base class for replacing standard import functions.
BuiltinImporter
_FilesystemImporter
DynLoadSuffixImporter
Functions [hide private]
 
_compile(pathname, timestamp)
Compile (and cache) a Python source file.
 
_os_bootstrap()
Set up 'os' module replacement functions for use during import bootstrap.
 
_os_path_isdir(pathname)
Local replacement for os.path.isdir().
 
_timestamp(pathname)
Return the file modification time as a Long.
 
py_suffix_importer(filename, finfo, fqname)
 
_print_importers()
 
_test_revamp()
Variables [hide private]
  _suffix_char = 'c'
  _suffix = '.pyc'
  _os_path_join = None
  _os_stat = None

Imports: imp, sys, __builtin__, struct, marshal, _StringType, _ModuleType


Function Details [hide private]

_compile(pathname, timestamp)

 

Compile (and cache) a Python source file.

The file specified by <pathname> is compiled to a code object and returned.

Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modification timestamp must be provided as a Long value.