# Path: src/meta.py
# class defaults:
# def print_env(prefix=''):
# 
# Path: src/logcfg.py
# DEBUG_TEMPL = '  %(levelname)-7.7s %(funcName)s: %(message)s'
# PROD_TEMPL  = '%(asctime)s %(levelname)-7.7s %(funcName)s: %(message)s'
# DEBUG = logging.DEBUG
# class ColorFmtr(Formatter):
#     def __init__(self, *args, **kwargs):
#     def format(self, record):
# def makefunc(level):
#         def tb_func(msg, *args, **kwargs):
#     def thefunc(msg, *args, **kwargs):
# 
# Path: src/auth.py
# def auth_handler(username, password):
# def load_user(payload):
# def check_auth(*args, **kwargs):


import atexit
import logging
from flask import Flask
from flask_admin import Admin
from flask_mail import Mail
from flask_migrate import Migrate
from flask_restless import APIManager
from flask_security import Security, SQLAlchemyUserDatastore
from flask_sqlalchemy import SQLAlchemy
from werkzeug.contrib.fixers import ProxyFix  # use remote address header
from . import config
from .meta import fullname
from .logcfg import log  # noqa: E402
from . import models, forms, views, admin, utils, errors  # noqa: F401,E402
    from . import models_app  # app models
    from . import admin_app  # app config
from .auth import rest_preprocessors  # noqa: E402
    from flask_debugtoolbar import DebugToolbarExtension
'''
    Main startup file.
'''




# main objects
app = Flask(__name__)
app.config.from_object(config)
app.wsgi_app = ProxyFix(app.wsgi_app)  # remote address header fix
db = SQLAlchemy(app)
mail = Mail(app)
migrate = Migrate(app, db)


# additional imports below avoid circular import issues w/flask objects.

# admin setup
adm = Admin(app, name=fullname, template_mode='bootstrap3',
            index_view=admin.HomeView(),
            category_icon_classes=admin.category_icon_classes,
            )
# optional modules
try:
except ImportError as err:

# Path: src/meta.py
# class defaults:
# def print_env(prefix=''):
# 
# Path: src/logcfg.py
# DEBUG_TEMPL = '  %(levelname)-7.7s %(funcName)s: %(message)s'
# PROD_TEMPL  = '%(asctime)s %(levelname)-7.7s %(funcName)s: %(message)s'
# DEBUG = logging.DEBUG
# class ColorFmtr(Formatter):
#     def __init__(self, *args, **kwargs):
#     def format(self, record):
# def makefunc(level):
#         def tb_func(msg, *args, **kwargs):
#     def thefunc(msg, *args, **kwargs):
# 
# Path: src/auth.py
# def auth_handler(username, password):
# def load_user(payload):
# def check_auth(*args, **kwargs):


# Path: src/main.py
import atexit
import logging
from flask import Flask
from flask_admin import Admin
from flask_mail import Mail
from flask_migrate import Migrate
from flask_restless import APIManager
from flask_security import Security, SQLAlchemyUserDatastore
from flask_sqlalchemy import SQLAlchemy
from werkzeug.contrib.fixers import ProxyFix  # use remote address header
from . import config
from .meta import fullname
from .logcfg import log  # noqa: E402
from . import models, forms, views, admin, utils, errors  # noqa: F401,E402
    from . import models_app  # app models
    from . import admin_app  # app config
from .auth import rest_preprocessors  # noqa: E402
    from flask_debugtoolbar import DebugToolbarExtension

'''
    Main startup file.
'''




# main objects
app = Flask(__name__)
app.config.from_object(config)
app.wsgi_app = ProxyFix(app.wsgi_app)  # remote address header fix
db = SQLAlchemy(app)
mail = Mail(app)
migrate = Migrate(app, db)


# additional imports below avoid circular import issues w/flask objects.

# admin setup
adm = Admin(app, name=fullname, template_mode='bootstrap3',
            index_view=admin.HomeView(),
            category_icon_classes=admin.category_icon_classes,
            )
# optional modules
try:
except ImportError as err:

    log.debug('%s: %s', err.__class__.__name__, err)