<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import logging

from django.apps import AppConfig
from django.conf import settings
from django.utils.translation import gettext_lazy as _

from maintenance_mode.core import set_maintenance_mode

from InvenTree.ready import isImportingData
from plugin import registry
from plugin.helpers import check_git_version, log_error


logger = logging.getLogger('inventree')


class PluginAppConfig(AppConfig):
    name = 'plugin'

    def ready(self):
        if settings.PLUGINS_ENABLED:

            if isImportingData():  # pragma: no cover
                logger.info('Skipping plugin loading for data import')
            else:
                logger.info('Loading InvenTree plugins')

                if not registry.is_loading:
                    # this is the first startup
                    try:
                        from common.models import InvenTreeSetting
                        if InvenTreeSetting.get_setting('PLUGIN_ON_STARTUP', create=False):
                            # make sure all plugins are installed
                            registry.install_plugin_file()
                    except:
                        pass
<commit_msg>do not coverage catch for load<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import logging

from django.apps import AppConfig
from django.conf import settings
from django.utils.translation import gettext_lazy as _

from maintenance_mode.core import set_maintenance_mode

from InvenTree.ready import isImportingData
from plugin import registry
from plugin.helpers import check_git_version, log_error


logger = logging.getLogger('inventree')


class PluginAppConfig(AppConfig):
    name = 'plugin'

    def ready(self):
        if settings.PLUGINS_ENABLED:

            if isImportingData():  # pragma: no cover
                logger.info('Skipping plugin loading for data import')
            else:
                logger.info('Loading InvenTree plugins')

                if not registry.is_loading:
                    # this is the first startup
                    try:
                        from common.models import InvenTreeSetting
                        if InvenTreeSetting.get_setting('PLUGIN_ON_STARTUP', create=False):
                            # make sure all plugins are installed
                            registry.install_plugin_file()
                    except:  # pragma: no cover
                        pass

{'fraction_non_alphanumeric': 0.057576969212315074, 'fraction_numerical': 0.0007996801279488205, 'mean_word_length': 2.0475030450669913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4192615', 'n_tokens_mistral': 623, 'n_tokens_neox': 598, 'n_words': 186}