mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use dynamic imports in modules manager
This commit is contained in:
parent
45f894bf3c
commit
c7e126bc6e
1 changed files with 10 additions and 0 deletions
|
|
@ -254,6 +254,8 @@ class ModulesManager:
|
|||
"""Import and initialize modules."""
|
||||
self.collect_modules()
|
||||
|
||||
import openpype_modules
|
||||
|
||||
self.log.debug("*** Pype modules initialization.")
|
||||
# Prepare settings for modules
|
||||
system_settings = getattr(self, "_system_settings", None)
|
||||
|
|
@ -395,6 +397,8 @@ class ModulesManager:
|
|||
and "actions" each containing list of paths.
|
||||
"""
|
||||
# Output structure
|
||||
from openpype_interfaces import IPluginPaths
|
||||
|
||||
output = {
|
||||
"publish": [],
|
||||
"create": [],
|
||||
|
|
@ -447,6 +451,8 @@ class ModulesManager:
|
|||
Returns:
|
||||
list: Paths to launch hook directories.
|
||||
"""
|
||||
from openpype_interfaces import ILaunchHookPaths
|
||||
|
||||
str_type = type("")
|
||||
expected_types = (list, tuple, set)
|
||||
|
||||
|
|
@ -647,6 +653,8 @@ class TrayModulesManager(ModulesManager):
|
|||
self.tray_menu(tray_menu)
|
||||
|
||||
def get_enabled_tray_modules(self):
|
||||
from openpype_interfaces import ITrayModule
|
||||
|
||||
output = []
|
||||
for module in self.modules:
|
||||
if module.enabled and isinstance(module, ITrayModule):
|
||||
|
|
@ -722,6 +730,8 @@ class TrayModulesManager(ModulesManager):
|
|||
self._report["Tray menu"] = report
|
||||
|
||||
def start_modules(self):
|
||||
from openpype_interfaces import ITrayService
|
||||
|
||||
report = {}
|
||||
time_start = time.time()
|
||||
prev_start_time = time_start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue