mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add docstrings
This commit is contained in:
parent
6affc7550b
commit
bb559deb5d
@ -59,7 +59,8 @@ class PluginsRegistry:
|
|||||||
# mixins
|
# mixins
|
||||||
self.mixins_settings = {}
|
self.mixins_settings = {}
|
||||||
|
|
||||||
# region public plugin functions
|
# region public functions
|
||||||
|
# region loading / unloading
|
||||||
def load_plugins(self):
|
def load_plugins(self):
|
||||||
"""
|
"""
|
||||||
Load and activate all IntegrationPlugins
|
Load and activate all IntegrationPlugins
|
||||||
@ -183,6 +184,8 @@ class PluginsRegistry:
|
|||||||
# Log collected plugins
|
# Log collected plugins
|
||||||
logger.info(f'Collected {len(self.plugin_modules)} plugins!')
|
logger.info(f'Collected {len(self.plugin_modules)} plugins!')
|
||||||
logger.info(", ".join([a.__module__ for a in self.plugin_modules]))
|
logger.info(", ".join([a.__module__ for a in self.plugin_modules]))
|
||||||
|
# endregion
|
||||||
|
# region registry functions
|
||||||
def with_mixin(self, mixin: str):
|
def with_mixin(self, mixin: str):
|
||||||
"""
|
"""
|
||||||
Returns reference to all plugins that have a specified mixin enabled
|
Returns reference to all plugins that have a specified mixin enabled
|
||||||
@ -194,6 +197,10 @@ class PluginsRegistry:
|
|||||||
result.append(plugin)
|
result.append(plugin)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
# endregion
|
||||||
|
# endregion
|
||||||
|
|
||||||
|
# region general internal loading /activating / deactivating / deloading
|
||||||
def _init_plugins(self, disabled=None):
|
def _init_plugins(self, disabled=None):
|
||||||
"""
|
"""
|
||||||
Initialise all found plugins
|
Initialise all found plugins
|
||||||
@ -286,7 +293,9 @@ class PluginsRegistry:
|
|||||||
self.deactivate_integration_app()
|
self.deactivate_integration_app()
|
||||||
self.deactivate_integration_schedule()
|
self.deactivate_integration_schedule()
|
||||||
self.deactivate_integration_settings()
|
self.deactivate_integration_settings()
|
||||||
|
# endregion
|
||||||
|
|
||||||
|
# region mixin specific loading ...
|
||||||
def activate_integration_settings(self, plugins):
|
def activate_integration_settings(self, plugins):
|
||||||
|
|
||||||
logger.info('Activating plugin settings')
|
logger.info('Activating plugin settings')
|
||||||
@ -533,6 +542,6 @@ class PluginsRegistry:
|
|||||||
return True, []
|
return True, []
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
get_plugin_error(error, do_raise=True)
|
get_plugin_error(error, do_raise=True)
|
||||||
|
# endregion
|
||||||
|
|
||||||
plugin_registry = PluginsRegistry()
|
plugin_registry = PluginsRegistry()
|
||||||
|
Loading…
Reference in New Issue
Block a user