# Path: rophako/settings.py
# class ConfigHandler(object):
#     def load_settings(self):
#     def print_settings(self):
#     def load_plugins(self):
#     def __getattr__(self, section):
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


from flask import request
from rophako.settings import Config
from rophako.log import logger
import os
import codecs
import json
import re
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""Emoticon models."""




_cache = {}


def load_theme():
    """Pre-load and cache the emoticon theme. This happens on startup."""
    theme = Config.emoticons.theme
    global _cache

    # Cached?
    if _cache:
        return _cache

    # Only if the theme file exists.
    settings = os.path.join(Config.emoticons.root_private, theme, "emoticons.json")
    if not os.path.isfile(settings):

# Path: rophako/settings.py
# class ConfigHandler(object):
#     def load_settings(self):
#     def print_settings(self):
#     def load_plugins(self):
#     def __getattr__(self, section):
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


# Path: rophako/model/emoticons.py
from flask import request
from rophako.settings import Config
from rophako.log import logger
import os
import codecs
import json
import re

# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""Emoticon models."""




_cache = {}


def load_theme():
    """Pre-load and cache the emoticon theme. This happens on startup."""
    theme = Config.emoticons.theme
    global _cache

    # Cached?
    if _cache:
        return _cache

    # Only if the theme file exists.
    settings = os.path.join(Config.emoticons.root_private, theme, "emoticons.json")
    if not os.path.isfile(settings):

        logger.error("Failed to load smiley theme {}: not found!")