# Path: tuskar/api/acl.py
# OPT_GROUP_NAME = 'keystone_authtoken'
# def register_opts(conf):
# def install(app, conf):
#     def before(self, state):
# class AdminAuthHook(hooks.PecanHook):
# 
# Path: tuskar/api/config.py

# 
# Path: tuskar/api/hooks.py
# class ConfigHook(hooks.PecanHook):
# class DBHook(hooks.PecanHook):
#     def before(self, state):
#     def before(self, state):
# 
# Path: tuskar/api/renderers.py
# class JSonRenderer(object):
#     def __init__(self, path, extra_vars):
#     def render(self, template_path, namespace):


from oslo.config import cfg
from tuskar.api import acl
from tuskar.api import config
from tuskar.api import hooks
from tuskar.api import renderers
import pecan
        help='Method to use for auth: noauth or keystone.'),
    ]

CONF = cfg.CONF
CONF.register_opts(auth_opts)


def get_pecan_config():
    # Set up the pecan configuration
    filename = config.__file__.replace('.pyc', '.py')
    return pecan.configuration.conf_from_file(filename)


def setup_app(pecan_config=None, extra_hooks=None):
    app_hooks = [hooks.ConfigHook(),
                 hooks.DBHook()]
    if extra_hooks:
        app_hooks.extend(extra_hooks)

    if not pecan_config:
        pecan_config = get_pecan_config()

    if pecan_config.app.enable_acl:
        app_hooks.append(acl.AdminAuthHook())

    pecan.configuration.set_config(dict(pecan_config), overwrite=True)

# TODO(deva): add middleware.ParsableErrorMiddleware from Ceilometer
    app = pecan.make_app(
        pecan_config.app.root,

# Path: tuskar/api/acl.py
# OPT_GROUP_NAME = 'keystone_authtoken'
# def register_opts(conf):
# def install(app, conf):
#     def before(self, state):
# class AdminAuthHook(hooks.PecanHook):
# 
# Path: tuskar/api/config.py

# 
# Path: tuskar/api/hooks.py
# class ConfigHook(hooks.PecanHook):
# class DBHook(hooks.PecanHook):
#     def before(self, state):
#     def before(self, state):
# 
# Path: tuskar/api/renderers.py
# class JSonRenderer(object):
#     def __init__(self, path, extra_vars):
#     def render(self, template_path, namespace):


# Path: tuskar/api/app.py
from oslo.config import cfg
from tuskar.api import acl
from tuskar.api import config
from tuskar.api import hooks
from tuskar.api import renderers
import pecan

        help='Method to use for auth: noauth or keystone.'),
    ]

CONF = cfg.CONF
CONF.register_opts(auth_opts)


def get_pecan_config():
    # Set up the pecan configuration
    filename = config.__file__.replace('.pyc', '.py')
    return pecan.configuration.conf_from_file(filename)


def setup_app(pecan_config=None, extra_hooks=None):
    app_hooks = [hooks.ConfigHook(),
                 hooks.DBHook()]
    if extra_hooks:
        app_hooks.extend(extra_hooks)

    if not pecan_config:
        pecan_config = get_pecan_config()

    if pecan_config.app.enable_acl:
        app_hooks.append(acl.AdminAuthHook())

    pecan.configuration.set_config(dict(pecan_config), overwrite=True)

# TODO(deva): add middleware.ParsableErrorMiddleware from Ceilometer
    app = pecan.make_app(
        pecan_config.app.root,

        custom_renderers=dict(wsmejson=renderers.JSonRenderer),