INNER CODE UNIT · Python

InjectPlugins

loxy0devlp/RedTiger-Tools · redtiger.py:35

def InjectPlugins(options_list):
    plugins = {}

    if os.path.exists(path_folder_plugins):
        for file in os.listdir(path_folder_plugins):
            if file == "Example.py": continue
            if not file.endswith(".py"): continue

            path        = os.path.join(path_folder_plugins, file)
            module_name = file[:-3]

            try:
                spec   = importlib.util.spec_from_file_location(module_name, path)
                module = importlib.util.module_from_spec(spec)
                spec.loader.exec_module(module)

                if hasattr(module, "Register"):
                    plugin_data = module.Register()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…