def _test_dir(): "Debug/test function to create DirectoryImporters from sys.path." imputil.ImportManager().install() path = sys.path[:] path.reverse() for d in path: sys.path.insert(0, DirectoryImporter(d)) sys.path.insert(0, imputil.BuiltinImporter())
#
def install(callback): "Install callback as a code-rewriting function for each imported module." import_manager.install() sys.path.insert(0, PathImporter(sys.path, callback)) sys.path.insert(0, imputil.BuiltinImporter())
def _test_revamp(): "Debug/test function for the revamped import system." imputil.ImportManager().install() sys.path.insert(0, PathImporter()) sys.path.insert(0, imputil.BuiltinImporter())