def enable(identifier = None, *args, **kwargs):
global cache<EOL>if not identifier:<EOL><INDENT>for item in (config['<STR_LIT>'] + ['<STR_LIT>']):<EOL><INDENT>if caches.has_key(item):<EOL><INDENT>debug('<STR_LIT>' % (item,))<EOL>cache = caches[item](*args, **kwargs)<EOL>if not cache.status():<EOL><INDENT>warning('<STR_LIT>' % (item, cache.server, cache.port))<EOL>continue<EOL><DEDENT>break<EOL><DEDENT>else:<EOL><INDENT>debug('<STR_LIT>' % (item,))<EOL><DEDENT><DEDENT><DEDENT>elif caches.has_key(identifier):<EOL><INDENT>debug('<STR_LIT>' % (identifier,))<EOL>previouscache = cache<EOL>cache = caches[identifier](*args, **kwargs)<EOL>if not cache.status():<EOL><INDENT>warning('<STR_LIT>' % (identifier, cache.server, cache.port))<EOL>cache = previouscache<EOL><DEDENT><DEDENT>else:<EOL><INDENT>debug('<STR_LIT>' % (identifier,))<EOL><DEDENT>
Enables a specific cache for the current session. Remember that is has to be registered.