<commit_before>
import logging
from django.apps import AppConfig

from django.utils.translation import ugettext_lazy as _
from .widget import *


default_app_config = 'leonardo.module.web.WebConfig'

LOG = logging.getLogger(__name__)


class Default(object):

    optgroup = 'Web'

    urls_conf = 'leonardo.module.web.urls'

    @property
    def page_extensions(self):

        return [
            'feincms.module.page.extensions.excerpt',
            'feincms.module.page.extensions.relatedpages',
            'feincms.module.page.extensions.navigation',
            'feincms.module.page.extensions.sites',
            'feincms.module.page.extensions.symlinks',
            'feincms.module.page.extensions.titles',
            'leonardo.extensions.seo',
            'leonardo.extensions.datepublisher',
            'leonardo.extensions.translations',
            'leonardo.extensions.changedate',
            'leonardo.extensions.ct_tracker',
            'leonardo.extensions.featured'
            ]

    @property
    def middlewares(self):

        middlewares = [
            'leonardo.module.web.middlewares.quickstart.QuickStartMiddleware', ]

        return middlewares + [
            'leonardo.module.web.middlewares.web.WebMiddleware',
            'leonardo.module.web.middlewares.horizon.HorizonMiddleware',
        ]

    @property
    def themes(self):
        """supported themes
        """
        return ['leonardo_theme_adminlte', 'leonardo_theme_bootswatch']

    @property
    def apps(self):

        INSTALLED_APPS = []
        for theme in self.themes:
            try:
                __import__(theme)
                INSTALLED_APPS += [theme]
            except ImportError:
                LOG.warning("you are missing available theme {}".format(theme))

        try:
            import sorl  # noqa
            INSTALLED_APPS += ['sorl.thumbnail']
        except Exception:
            pass

        try:
            import easy_thumbnails  # noqa
            INSTALLED_APPS += ['easy_thumbnails']
        except Exception:
            pass

        return INSTALLED_APPS + [
            'feincms',
            'mptt',
            'crispy_forms',
            'floppyforms',

            'dbtemplates',
            'leonardo.module',

            'feincms.module.page',  # noqa

            'leonardo.module.web',

            'markupfield',
        ]

    @property
    def context_processors(self):
        """return WEB Conent Type Processors
        """
        return [
            'leonardo.module.web.processors.page.add_page_if_missing',
        ]

    @property
    def widgets(self):
        return [
            ApplicationWidget,
            SiteHeadingWidget,
            MarkupTextWidget,
            FeedReaderWidget,
            HtmlTextWidget,
            PageTitleWidget,
            IconWidget,
        ]

    plugins = [
        ('leonardo.module.web.apps.horizon', _('Horizon'))
    ]

    js_files = [
        'extra/js/wow.min.js',
    ]

    css_files = [
        'extra/css/animate.css',
    ]

    config = {
        'META_KEYWORDS': ('', _('Site specific meta keywords')),
        'META_DESCRIPTION': ('', _('Site specific meta description')),
        'META_TITLE': ('', _('Site specific meta title')),
        'DEBUG': (True, _('Debug mode')),
        'FAVICON_PATH': ('/static/img/favicon.ico', _('Favicon path')),
    }

    page_actions = ['base/page/_actions.html']
    widget_actions = ['base/widget/_actions.html']


class WebConfig(AppConfig, Default):
    name = 'leonardo.module.web'
    verbose_name = "CMS"

    def ready(self):

        # register signals
        from leonardo.module.web.signals import save as template_save
        from dbtemplates.models import Template

        Template.save = template_save


default = Default()
<commit_msg>remove useless stuff from web init<commit_after>
import logging
from django.apps import AppConfig

from django.utils.translation import ugettext_lazy as _
from .widget import *


default_app_config = 'leonardo.module.web.WebConfig'

LOG = logging.getLogger(__name__)


class Default(object):

    optgroup = 'Web'

    urls_conf = 'leonardo.module.web.urls'

    @property
    def page_extensions(self):

        return [
            'feincms.module.page.extensions.excerpt',
            'feincms.module.page.extensions.relatedpages',
            'feincms.module.page.extensions.navigation',
            'feincms.module.page.extensions.sites',
            'feincms.module.page.extensions.symlinks',
            'feincms.module.page.extensions.titles',
            'leonardo.extensions.seo',
            'leonardo.extensions.datepublisher',
            'leonardo.extensions.translations',
            'leonardo.extensions.changedate',
            'leonardo.extensions.ct_tracker',
            'leonardo.extensions.featured'
            ]

    @property
    def middlewares(self):

        middlewares = [
            'leonardo.module.web.middlewares.quickstart.QuickStartMiddleware', ]

        return middlewares + [
            'leonardo.module.web.middlewares.web.WebMiddleware',
            'leonardo.module.web.middlewares.horizon.HorizonMiddleware',
        ]

    @property
    def apps(self):

        INSTALLED_APPS = []

        try:
            import sorl  # noqa
            INSTALLED_APPS += ['sorl.thumbnail']
        except Exception:
            pass

        try:
            import easy_thumbnails  # noqa
            INSTALLED_APPS += ['easy_thumbnails']
        except Exception:
            pass

        return INSTALLED_APPS + [
            'feincms',
            'mptt',
            'crispy_forms',
            'floppyforms',

            'dbtemplates',
            'leonardo.module',

            'feincms.module.page',  # noqa

            'leonardo.module.web',

            'markupfield',
        ]

    @property
    def context_processors(self):
        """return WEB Conent Type Processors
        """
        return [
            'leonardo.module.web.processors.page.add_page_if_missing',
        ]

    @property
    def widgets(self):
        return [
            ApplicationWidget,
            SiteHeadingWidget,
            MarkupTextWidget,
            FeedReaderWidget,
            HtmlTextWidget,
            PageTitleWidget,
            IconWidget,
        ]

    plugins = [
        ('leonardo.module.web.apps.horizon', _('Horizon'))
    ]

    js_files = [
        'extra/js/wow.min.js',
    ]

    css_files = [
        'extra/css/animate.css',
    ]

    config = {
        'META_KEYWORDS': ('', _('Site specific meta keywords')),
        'META_DESCRIPTION': ('', _('Site specific meta description')),
        'META_TITLE': ('', _('Site specific meta title')),
        'DEBUG': (True, _('Debug mode')),
        'FAVICON_PATH': ('/static/img/favicon.ico', _('Favicon path')),
    }

    page_actions = ['base/page/_actions.html']
    widget_actions = ['base/widget/_actions.html']


class WebConfig(AppConfig, Default):
    name = 'leonardo.module.web'
    verbose_name = "CMS"

    def ready(self):

        # register signals
        from leonardo.module.web.signals import save as template_save
        from dbtemplates.models import Template

        Template.save = template_save


default = Default()

{'fraction_non_alphanumeric': 0.11022430163753956, 'fraction_numerical': 0.0, 'mean_word_length': 1.9544715447154473, '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': '7225378', 'n_tokens_mistral': 2208, 'n_tokens_neox': 2117, 'n_words': 359}