# Path: shimehari/shared.py
# class _SharedRequestClass(object):
# def _lookUpObjectInRequestContext(name):
# def findApp():
# 
# Path: shimehari/core/helpers.py
# def importFromString(targetName):
#     if isinstance(targetName, unicode):
#         targetName = str(targetName)
#     try:
#         if '.' in targetName:
#             pkgs, obj = targetName.rsplit('.', 1)
#         else:
#             return __import__('config')
#         try:
#             return getattr(__import__(pkgs, fromlist=[obj]), obj)
#         except (ImportError, AttributeError):
#             pkgName = pkgs + '.' + obj
#             __import__(pkgName)
#             return sys.modules[pkgName]
# 
#     except ImportError, error:
#         raise ImportError(error)


import os
import sys
import re
import urlparse
import pkgutil
import mimetypes
    import json
        import simplejson as json
    import redis
import sgmllib
import glob
    import shimehari
from time import time
from zlib import adler32
from threading import RLock
            from django.utils import simplejson as json
from werkzeug.datastructures import Headers
from werkzeug.wsgi import wrap_file
from werkzeug.urls import url_quote
from werkzeug.routing import BuildError
from werkzeug.exceptions import NotFound
from shimehari.shared import session, currentApp, request, _appContextStack, _requestContextStack
from shimehari.core.helpers import importFromString
        from warnings import warn
        from shimehari.configuration import ConfigManager
    from shimehari.shared import request
    def __get__(self, obj, type=None):
        if obj is None:
            return self
        with self.lock:
            value = obj.__dict__.get(self.__name__, _missing)
            if value is _missing:
                value = self.func(obj)
                obj.__dict__[self.__name__] = value
            return value


def getTemplater(app, templaterName, *args, **options):
    templateDir = os.path.join(shimehari.__path__[0], 'template', templaterName)
    if not os.path.isdir(templateDir):
        raise ValueError('template engine not found :: %s\n' % templateDir)
    try:
        module = importFromString('shimehari.template.' + templaterName)
        templater = module.templater
    except Exception, e:
        raise Exception(e)
    return templater(app, *args, **options)


def flash(message, category='message'):
    u"""次のリクエストが発生するまで存在する揮発性のあるメッセージ。

    :param message: メッセージ。次のリクエストがあった際には消滅します。
    :param category: カテゴリー

    """

# Path: shimehari/shared.py
# class _SharedRequestClass(object):
# def _lookUpObjectInRequestContext(name):
# def findApp():
# 
# Path: shimehari/core/helpers.py
# def importFromString(targetName):
#     if isinstance(targetName, unicode):
#         targetName = str(targetName)
#     try:
#         if '.' in targetName:
#             pkgs, obj = targetName.rsplit('.', 1)
#         else:
#             return __import__('config')
#         try:
#             return getattr(__import__(pkgs, fromlist=[obj]), obj)
#         except (ImportError, AttributeError):
#             pkgName = pkgs + '.' + obj
#             __import__(pkgName)
#             return sys.modules[pkgName]
# 
#     except ImportError, error:
#         raise ImportError(error)


# Path: shimehari/helpers.py
import os
import sys
import re
import urlparse
import pkgutil
import mimetypes
    import json
        import simplejson as json
    import redis
import sgmllib
import glob
    import shimehari
from time import time
from zlib import adler32
from threading import RLock
            from django.utils import simplejson as json
from werkzeug.datastructures import Headers
from werkzeug.wsgi import wrap_file
from werkzeug.urls import url_quote
from werkzeug.routing import BuildError
from werkzeug.exceptions import NotFound
from shimehari.shared import session, currentApp, request, _appContextStack, _requestContextStack
from shimehari.core.helpers import importFromString
        from warnings import warn
        from shimehari.configuration import ConfigManager
    from shimehari.shared import request

    def __get__(self, obj, type=None):
        if obj is None:
            return self
        with self.lock:
            value = obj.__dict__.get(self.__name__, _missing)
            if value is _missing:
                value = self.func(obj)
                obj.__dict__[self.__name__] = value
            return value


def getTemplater(app, templaterName, *args, **options):
    templateDir = os.path.join(shimehari.__path__[0], 'template', templaterName)
    if not os.path.isdir(templateDir):
        raise ValueError('template engine not found :: %s\n' % templateDir)
    try:
        module = importFromString('shimehari.template.' + templaterName)
        templater = module.templater
    except Exception, e:
        raise Exception(e)
    return templater(app, *args, **options)


def flash(message, category='message'):
    u"""次のリクエストが発生するまで存在する揮発性のあるメッセージ。

    :param message: メッセージ。次のリクエストがあった際には消滅します。
    :param category: カテゴリー

    """

    flashes = session.get('_flashes', [])