Skip to content
Myr

experimental alternative client creation for the memcached loader

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 2bf7b3b · Browse files · 1 file+13 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−10 removed

  • other:+13 added−10 removed

1 file+13 added−10 removed

modified:jinja/loaders.py+13 added-10 removed
270 unmodified lines
271 __ http://www.tummy.com/Community/software/python-memcached/272 """273274 def __init__(self, use_memcache, memcache_time=60 * 60 * 24 * 7,275 memcache_host=None, item_prefix='template/'):276 try:277 try:278 from cmemcache import Client279 except ImportError:280 from memcache import Client281 except ImportError:282 raise RuntimeError('the %r loader requires an installed '283 'memcache module' % self.__class__.__name__)275 memcache_host=None, item_prefix='template/', client=None):276 if memcache_host is None:277 memcache_host = ['127.0.0.1:11211']278 if use_memcache:279 if client is None:280 try:281 try:282 from cmemcache import Client283 except ImportError:284 from memcache import Client285 except ImportError:286 raise RuntimeError('the %r loader requires an installed '287 'memcache module' %288 self.__class__.__name__)287 self.__memcache = Client(list(memcache_host))289 client = Client(list(memcache_host))290 self.__memcache = client291 self.__memcache_time = memcache_time292 else:293 self.__memcache = None294 self.__item_prefix = item_prefix
474 unmodified lines