Package flumotion :: Package common :: Module package :: Class _PatchedModuleImporter
[hide private]

Class _PatchedModuleImporter

source code

       ihooks._Verbose --+        
                         |        
ihooks.BasicModuleImporter --+    
                             |    
         ihooks.ModuleImporter --+
                                 |
                                _PatchedModuleImporter

I am overriding ihook's ModuleImporter's import_module() method to accept (and ignore) the 'level' keyword argument that appeared in the built-in __import__() function in python2.5.

While no built-in modules in python2.5 seem to use that keyword argument, 'encodings' module in python2.6 does and so it breaks if used together with ihooks.

I make no attempt to properly support the 'level' argument - ihooks didn't make it into py3k, and the only use in python2.6 we've seen so far, in 'encodings', serves as a performance hint and it seems that can be ignored with no difference in behaviour.

Instance Methods [hide private]
 
import_module(self, name, globals=None, locals=None, fromlist=None, level=-1) source code

Inherited from ihooks.ModuleImporter: determine_parent, ensure_fromlist, find_head_package, import_it, load_tail, reload

Inherited from ihooks.BasicModuleImporter: __init__, get_hooks, get_loader, install, set_hooks, set_loader, uninstall, unload

Inherited from ihooks._Verbose: get_verbose, message, note, set_verbose

Method Details [hide private]

import_module(self, name, globals=None, locals=None, fromlist=None, level=-1)

source code 
Overrides: ihooks.BasicModuleImporter.import_module