Files
Touchh/pms_integration/utils.py

22 lines
900 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pms_integration.admin import PluginLoader
def get_all_plugins():
"""
Загружает все плагины и возвращает их данные.
:return: Словарь с данными о плагинах.
"""
plugins_data = {}
try:
# Загружаем плагины
plugins = PluginLoader.load_plugins()
for plugin_name, plugin_class in plugins.items():
plugins_data[plugin_name] = {
"class_name": plugin_class.__name__, # Имя класса
"description": plugin_class.__doc__, # Описание из DocString
"module": plugin_class.__module__, # Модуль, где определён класс
}
except Exception as e:
print(f"[ERROR] Ошибка загрузки данных о плагинах: {e}")
return plugins_data