

@classmethod
def _refresh(cls):
    'Repopulate the registry.'
    cls._rte_components.clear()
    extension_paths = [component['dir'] for component in feconf.ALLOWED_RTE_EXTENSIONS.values()]
    for (loader, name, _) in pkgutil.iter_modules(path=extension_paths):
        module = loader.find_module(name).load_module(name)
        clazz = getattr(module, name)
        ancestor_names = [base_class.__name__ for base_class in clazz.__bases__]
        if ('BaseRichTextComponent' in ancestor_names):
            cls._rte_components[clazz.__name__] = clazz()

dataset/ETHPy150Open oppia/oppia/core/domain/rte_component_registry.py Registry._refresh/original