mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
ModulesManager can accept different settings data
This commit is contained in:
parent
a5ad0e831a
commit
77627a167c
1 changed files with 14 additions and 2 deletions
|
|
@ -285,12 +285,20 @@ class ITrayService(ITrayModule):
|
|||
|
||||
|
||||
class ModulesManager:
|
||||
"""Manager of Pype modules helps to load and prepare them to work.
|
||||
|
||||
Args:
|
||||
modules_settings(dict): To be able create module manager with specified
|
||||
data. For settings changes callbacks and testing purposes.
|
||||
"""
|
||||
# Helper attributes for report
|
||||
_report_total_key = "Total"
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, _system_settings=None):
|
||||
self.log = logging.getLogger(self.__class__.__name__)
|
||||
|
||||
self._system_settings = _system_settings
|
||||
|
||||
self.modules = []
|
||||
self.modules_by_id = {}
|
||||
self.modules_by_name = {}
|
||||
|
|
@ -304,7 +312,11 @@ class ModulesManager:
|
|||
"""Import and initialize modules."""
|
||||
self.log.debug("*** Pype modules initialization.")
|
||||
# Prepare settings for modules
|
||||
modules_settings = get_system_settings()["modules"]
|
||||
if self._system_settings is None:
|
||||
system_settings = get_system_settings()
|
||||
else:
|
||||
system_settings = self._system_settings
|
||||
modules_settings = system_settings["modules"]
|
||||
|
||||
report = {}
|
||||
time_start = time.time()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue