mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
move imports
This commit is contained in:
parent
4b3d5b27a6
commit
9f0882d637
@ -24,8 +24,6 @@ except:
|
||||
from maintenance_mode.core import maintenance_mode_on
|
||||
from maintenance_mode.core import get_maintenance_mode, set_maintenance_mode
|
||||
|
||||
from InvenTree.helpers import log_plugin_error
|
||||
|
||||
from plugin import plugins as inventree_plugins
|
||||
from plugin.integration import IntegrationPluginBase
|
||||
|
||||
@ -53,6 +51,8 @@ class PluginAppConfig(AppConfig):
|
||||
# region public plugin functions
|
||||
def load_plugins(self):
|
||||
"""load and activate all IntegrationPlugins"""
|
||||
from InvenTree.helpers import log_plugin_error
|
||||
|
||||
logger.info('Start loading plugins')
|
||||
# set maintanace mode
|
||||
_maintenance = bool(get_maintenance_mode())
|
||||
@ -143,6 +143,7 @@ class PluginAppConfig(AppConfig):
|
||||
:type disabled: str, optional
|
||||
:raises error: PluginLoadingError
|
||||
"""
|
||||
from InvenTree.helpers import log_plugin_error
|
||||
from plugin.models import PluginConfig
|
||||
|
||||
logger.info('Starting plugin initialisation')
|
||||
|
@ -9,8 +9,6 @@ import logging
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import AppRegistryNotReady
|
||||
|
||||
from InvenTree.helpers import log_plugin_error
|
||||
|
||||
# Action plugins
|
||||
import plugin.builtin.action as action
|
||||
from plugin.action import ActionPlugin
|
||||
@ -29,6 +27,8 @@ def iter_namespace(pkg):
|
||||
|
||||
def get_modules(pkg, recursive: bool = False):
|
||||
"""get all modules in a package"""
|
||||
from InvenTree.helpers import log_plugin_error
|
||||
|
||||
if not recursive:
|
||||
return [importlib.import_module(name) for finder, name, ispkg in iter_namespace(pkg)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user