# Path: solace/templating.py
# def get_theme(name=None):
#     """Returns the specified theme of the one from the config.  If the
#     theme does not exist, `None` is returned.
#     """
#     global _theme
#     set_theme = False
#     with _theme_lock:
#         if name is None:
#             if _theme is not None:
#                 return _theme
#             name = settings.THEME
#             set_theme = True
#         for folder in chain(settings.THEME_PATH, DEFAULT_THEME_PATH):
#             theme_dir = path.join(folder, name)
#             if path.isfile(path.join(theme_dir, 'theme.ini')):
#                 rv = Theme(theme_dir)
#                 if set_theme:
#                     _theme = rv
#                 return rv
# 
# Path: solace/settings.py
# def configure(**values):
# def revert_to_default():
# def autodiscover_settings():
# def configure_from_file(filename):
# def describe_settings():


import os
import mimetypes
from werkzeug import Response, wrap_file
from werkzeug.exceptions import NotFound
from solace.templating import get_theme
from solace import settings
# -*- coding: utf-8 -*-
"""
    solace.views.themes
    ~~~~~~~~~~~~~~~~~~~

    Implements support for the themes.

    :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""


def get_resource(request, theme, file):
    """Returns a file from the theme."""

# Path: solace/templating.py
# def get_theme(name=None):
#     """Returns the specified theme of the one from the config.  If the
#     theme does not exist, `None` is returned.
#     """
#     global _theme
#     set_theme = False
#     with _theme_lock:
#         if name is None:
#             if _theme is not None:
#                 return _theme
#             name = settings.THEME
#             set_theme = True
#         for folder in chain(settings.THEME_PATH, DEFAULT_THEME_PATH):
#             theme_dir = path.join(folder, name)
#             if path.isfile(path.join(theme_dir, 'theme.ini')):
#                 rv = Theme(theme_dir)
#                 if set_theme:
#                     _theme = rv
#                 return rv
# 
# Path: solace/settings.py
# def configure(**values):
# def revert_to_default():
# def autodiscover_settings():
# def configure_from_file(filename):
# def describe_settings():


# Path: solace/views/themes.py
import os
import mimetypes
from werkzeug import Response, wrap_file
from werkzeug.exceptions import NotFound
from solace.templating import get_theme
from solace import settings

# -*- coding: utf-8 -*-
"""
    solace.views.themes
    ~~~~~~~~~~~~~~~~~~~

    Implements support for the themes.

    :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""


def get_resource(request, theme, file):
    """Returns a file from the theme."""

    theme = get_theme(theme)