def newImp(name, globals=None, locals=None, fromlist=None, *rest, **kwargs): if name == EcModuleName: core.setActiveModule(getCallingModule()) return origImp(name, globals, locals, fromlist, *rest, **kwargs) else: imported = origImp(name, globals, locals, fromlist, *rest, **kwargs) module_name = getModuleFullName(imported, globals) if fromlist and sys.modules.has_key( '%s.%s' % (module_name, fromlist[0]) ): # several modules from a package are being imported in a single statement. Ex: from pkg import m1, m2 for item in fromlist: processModule('%s.%s' % (module_name, item)) else: processModule(module_name) return imported
def module(**Config): r"""Helps with adding configs to Modules. Note: Config is a same as that of **group**. """ Underlying = getCallingModule() Underlying.__ec_member__.Config.update(**Config)
def newImp(name, globals=None, locals=None, fromlist=None, *rest, **kwargs): if name == EcModuleName: core.setActiveModule(getCallingModule()) return origImp(name, globals, locals, fromlist, *rest, **kwargs) else: imported = origImp(name, globals, locals, fromlist, *rest, **kwargs) module_name = getModuleFullName(imported, globals) if fromlist and sys.modules.has_key('%s.%s' % (module_name, fromlist[0])): # several modules from a package are being imported in a single statement. Ex: from pkg import m1, m2 for item in fromlist: processModule('%s.%s' % (module_name, item)) else: processModule(module_name) return imported