From ca43deb9769b4a6a9cfb7fbab7fb4d2256c2c403 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 24 May 2013 21:06:34 +0200 Subject: moved common to utils package --- module/utils/ImportDebugger.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 module/utils/ImportDebugger.py (limited to 'module/utils/ImportDebugger.py') diff --git a/module/utils/ImportDebugger.py b/module/utils/ImportDebugger.py new file mode 100644 index 000000000..a997f7b0c --- /dev/null +++ b/module/utils/ImportDebugger.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +import sys + +class ImportDebugger(object): + + def __init__(self): + self.imported = {} + + def find_module(self, name, path=None): + + if name not in self.imported: + self.imported[name] = 0 + + self.imported[name] += 1 + + print name, path + +sys.meta_path.append(ImportDebugger()) \ No newline at end of file -- cgit v1.2.3