# Path: shimehari/core/helpers.py
# def importPreferredMemcachedClient(servers):
#     try:
#         import pylibmc
#     except ImportError, e:
#         pass
#     else:
#         return pylibmc.Client(servers)
# 
#     try:
#         import memcache
#     except ImportError, e:
#         try:
#             import cmemcache as memcache
#         except ImportError, e:
#             pass
#     else:
#         return memcache.Client(servers)
# 
#     try:
#         from google.appengine.api import memecache
#     except ImportError, e:
#         pass
#     else:
#         return memcache.Client()
# 
#     raise RuntimeError('no memcache modules.')


import os
import tempfile
    import cPickle as msg
    import pickle as msg
import re
                import redis
    from hashlib import md5
    from md5 import new as md5
from itertools import izip
from time import time
from shimehari.core.helpers import importPreferredMemcachedClient
        Shimehari.core.cachestore.SimpleCacheStore
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        delete

        指定されたキーのキャッシュを削除します。

    ------------------------------"""
    def delete(self, key):
        self._cache.pop(key, None)




u"""-----------------------------
    Shimehari.core.cachestore.MemcachedCacheStore
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Memcache を使ったキャッシュストア
    ------------------------------"""


_testMemcachedKey = re.compile(r'[^\x00-\x21\xff]{1,250}$').match


class MemcachedCacheStore(BaseCacheStore):
    def __init__(self, servers=None, default_timeout=300, key_prefix=None):
        BaseCacheStore.__init__(self, default_timeout)
        if servers is None or isinstance(servers, (list, tuple)):
            if servers is None:
                servers = ['127.0.0.1:11211']

# Path: shimehari/core/helpers.py
# def importPreferredMemcachedClient(servers):
#     try:
#         import pylibmc
#     except ImportError, e:
#         pass
#     else:
#         return pylibmc.Client(servers)
# 
#     try:
#         import memcache
#     except ImportError, e:
#         try:
#             import cmemcache as memcache
#         except ImportError, e:
#             pass
#     else:
#         return memcache.Client(servers)
# 
#     try:
#         from google.appengine.api import memecache
#     except ImportError, e:
#         pass
#     else:
#         return memcache.Client()
# 
#     raise RuntimeError('no memcache modules.')


# Path: shimehari/core/cachestore.py
import os
import tempfile
    import cPickle as msg
    import pickle as msg
import re
                import redis
    from hashlib import md5
    from md5 import new as md5
from itertools import izip
from time import time
from shimehari.core.helpers import importPreferredMemcachedClient

        Shimehari.core.cachestore.SimpleCacheStore
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        delete

        指定されたキーのキャッシュを削除します。

    ------------------------------"""
    def delete(self, key):
        self._cache.pop(key, None)




u"""-----------------------------
    Shimehari.core.cachestore.MemcachedCacheStore
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Memcache を使ったキャッシュストア
    ------------------------------"""


_testMemcachedKey = re.compile(r'[^\x00-\x21\xff]{1,250}$').match


class MemcachedCacheStore(BaseCacheStore):
    def __init__(self, servers=None, default_timeout=300, key_prefix=None):
        BaseCacheStore.__init__(self, default_timeout)
        if servers is None or isinstance(servers, (list, tuple)):
            if servers is None:
                servers = ['127.0.0.1:11211']

            self._client = importPreferredMemcachedClient(servers)