def refresh( submodule ): if submodule in _loaded_module_objects: module = _loaded_module_objects[submodule] dlog("Attempting reload '%s'..." % submodule) try: module = reload(module) except Exception, e: dtrace("There was an error reloading %s :" % module.__file__) return False finally:
def get( module, submodule ): if submodule in _loaded_module_objects: return _loaded_module_objects[ submodule ].exported_class full_path = '.'.join( ['src', module, submodule, 'exported_class'] ) try: cls, mod = _get_class(full_path) #dlog("Dynamically loaded %s from %s" % (cls, mod.__file__)) _loaded_module_objects[ submodule ] = mod return cls except Exception, e: dtrace("Exception dynamically importing %s.%s" % (module, submodule)) return None