RollbackImporter — Importing and Unloading of Modules.

class lib.RollbackImporter.RollbackImporter

RollbackImporter.

RollbackImporter instances install themselves as a proxy for the built-in __import__ function that lies behind the ‘import’ statement. Once installed, they note all imported modules, and when uninstalled, they delete those modules from the system module list; this ensures that the modules will be freshly loaded from their source code when next imported.

Usage:
if self.rollbackImporter:
self.rollbackImporter.uninstall()

self.rollbackImporter = RollbackImporter() # import some modules

uninstall()
Unload all modules since __init__ and restore the original import.

Module author: Bastian Venthur <venthur@cs.tu-berlin.de>

Previous topic

PluginController — Finding and Loading Feedbacks.

Next topic

Feedback Base Classes

This Page