Created
October 9, 2008 22:14
-
-
Save inklesspen/15919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImportPrinter(object): | |
def __init__(self): | |
record = set() | |
self.install() | |
def install(self): | |
import sys | |
sys.meta_path.insert(0, self) | |
def find_module(self, fullname, path=None): | |
record.append(fullname) | |
return None | |
def report(self): | |
return self.record |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment