<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
management script
~~~~~~~~~~~~~~~~~

Run the application, take administrative action.

:Copyright: 2006-2016 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

import ssl

from flask.ext.script import Manager
from flask.ext.script.commands import Server
from werkzeug.wsgi import SharedDataMiddleware

from byceps.application import create_app, init_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.blueprints.shop.models.article import Article
from byceps.blueprints.shop.models.order import Order, OrderItem, \
    PaymentState as OrderPaymentState
from byceps.blueprints.user.models.detail import UserDetail
from byceps.blueprints.user.models.user import User
from byceps.database import db
from byceps.util.system import get_config_env_name_from_env


environment = get_config_env_name_from_env(default='development')

app = create_app(environment)
init_app(app)

if app.debug:
    exports = {
        '/users/avatars': str(app.config['PATH_USER_AVATAR_IMAGES']),
    }

    path_brand = app.config.get('PATH_BRAND')
    if path_brand:
        exports['/brand'] = str(path_brand)

    path_party = app.config.get('PATH_PARTY')
    if path_party:
        exports['/party'] = str(path_party)

    app.wsgi_app = SharedDataMiddleware(app.wsgi_app, exports)

    from flask_debugtoolbar import DebugToolbarExtension
    app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
    toolbar = DebugToolbarExtension(app)

manager = Manager(app)


class SslServer(Server):<commit_msg>Serve static files from global path in debug ("development") mode as well.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
management script
~~~~~~~~~~~~~~~~~

Run the application, take administrative action.

:Copyright: 2006-2016 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

import ssl

from flask.ext.script import Manager
from flask.ext.script.commands import Server
from werkzeug.wsgi import SharedDataMiddleware

from byceps.application import create_app, init_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.blueprints.shop.models.article import Article
from byceps.blueprints.shop.models.order import Order, OrderItem, \
    PaymentState as OrderPaymentState
from byceps.blueprints.user.models.detail import UserDetail
from byceps.blueprints.user.models.user import User
from byceps.database import db
from byceps.util.system import get_config_env_name_from_env


environment = get_config_env_name_from_env(default='development')

app = create_app(environment)
init_app(app)

if app.debug:
    exports = {
        '/users/avatars': str(app.config['PATH_USER_AVATAR_IMAGES']),
    }

    path_global = app.config.get('PATH_GLOBAL')
    if path_global:
        exports['/global'] = str(path_global)

    path_brand = app.config.get('PATH_BRAND')
    if path_brand:
        exports['/brand'] = str(path_brand)

    path_party = app.config.get('PATH_PARTY')
    if path_party:
        exports['/party'] = str(path_party)

    app.wsgi_app = SharedDataMiddleware(app.wsgi_app, exports)

    from flask_debugtoolbar import DebugToolbarExtension
    app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
    toolbar = DebugToolbarExtension(app)

manager = Manager(app)


class SslServer(Server):
{'fraction_non_alphanumeric': 0.10540223135642983, 'fraction_numerical': 0.005284791544333529, 'mean_word_length': 4.764805414551607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4835505', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1052, 'n_words': 244}